Skip to content

Instantly share code, notes, and snippets.

@GuillaumeFalourd
Last active August 20, 2024 11:17
Show Gist options
  • Select an option

  • Save GuillaumeFalourd/0a30e0efc3bc2a84f1b0ebddbea7a380 to your computer and use it in GitHub Desktop.

Select an option

Save GuillaumeFalourd/0a30e0efc3bc2a84f1b0ebddbea7a380 to your computer and use it in GitHub Desktop.

The issue you're experiencing with the odoo job being skipped could be due to several reasons. Here are a few potential causes and solutions:

  1. Conditional Check Failure: The odoo job has a conditional check:
    if: ${{ needs.versions.outputs.names_comma != '' }}

If the names_comma output from the versions job is an empty string, the odoo job will be skipped. Ensure that the versions job is producing the expected output.

  1. Output Propagation: Ensure that the outputs from the prev_git_tag_info and versions jobs are correctly propagated and used in the odoo job. Any issue in these jobs can cause the odoo job to be skipped.

  2. Job Dependencies: The odoo job depends on the versions job:

    needs: [versions]

If the versions job fails or is skipped, the odoo job will not run. Check the logs of the versions job to ensure it completes successfully.

  1. Matrix Strategy: The odoo job uses a matrix strategy:
    strategy:
      fail-fast: false
      matrix:
        version: "${{ fromJSON( needs.versions.outputs.names_json ) }}"

Ensure that the names_json output from the versions job is a valid JSON array. Any issue in parsing this JSON can cause the job to be skipped.

  1. GitHub Actions Cache: Sometimes, GitHub Actions cache can cause unexpected behavior. Try clearing the cache or using a different runner to see if the issue persists.

  2. Re-run Behavior: Since re-running the workflow from the GitHub UI triggers the job correctly, it might be an intermittent issue or a race condition. Adding some debug steps to log the outputs and conditions can help identify the root cause.

Here is an example of how you can add debug steps to log the outputs and conditions:

    odoo:
      needs: [versions]
      if: ${{ needs.versions.outputs.names_comma != '' }}
      strategy:
        fail-fast: false
        matrix:
          version: "${{ fromJSON( needs.versions.outputs.names_json ) }}"
      steps:
        - name: Debug - Log names_comma
          run: echo "names_comma: ${{ needs.versions.outputs.names_comma }}"
        - name: Debug - Log names_json
          run: echo "names_json: ${{ needs.versions.outputs.names_json }}"
        - name: Debug - Log condition
          run: echo "Condition: ${{ needs.versions.outputs.names_comma != '' }}"
        - name: Checkout monodoo
          uses: actions/checkout@v4
        # Add the rest of your steps here

By adding these debug steps, you can check the logs to see the values of names_comma, names_json, and the condition result. This can help you identify if there is an issue with the outputs or the condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment