diff --git a/.github/workflows/czishrink_codeql.yml b/.github/workflows/czishrink_codeql.yml index dc0fcd9..5ff4ad3 100644 --- a/.github/workflows/czishrink_codeql.yml +++ b/.github/workflows/czishrink_codeql.yml @@ -25,12 +25,6 @@ jobs: changes: uses: ./.github/workflows/subproject-changes.yml - debug: - needs: changes - runs-on: ubuntu-latest - steps: - - run: echo czishrink ${{ needs.changes.outputs.czishrink }} czicompress ${{ needs.changes.outputs.czicompress }} - analyze: needs: changes if: ${{ needs.changes.outputs.czishrink == 'true' }} diff --git a/.github/workflows/subproject-changes.yml b/.github/workflows/subproject-changes.yml index 180491b..866e60e 100644 --- a/.github/workflows/subproject-changes.yml +++ b/.github/workflows/subproject-changes.yml @@ -14,20 +14,20 @@ on: workflow_call: outputs: czishrink: - description: "true if the change affects czishrink or if github.event_name is not 'pull_request'; false otherwise" - value: ${{ jobs.changes.outputs.czishrink }} + description: "'true' if the change affects czishrink or if github.event_name is not 'pull_request'; 'false' otherwise" + value: ${{ jobs.detect_changes.outputs.czishrink }} czicompress: - description: "true if the change affects czicompress or if github.event_name is not 'pull_request'; false otherwise" - value: ${{ jobs.changes.outputs.czishrink }} + description: "'true' if the change affects czicompress or if github.event_name is not 'pull_request'; 'false' otherwise" + value: ${{ jobs.detect_changes.outputs.czicompress }} jobs: # JOB to run change detection - changes: + detect_changes: runs-on: ubuntu-latest # Set job outputs to values from filter step for PRs, and true for other events. outputs: - czishrink: ${{ github.event_name != 'pull_request' || steps.filter.outputs.czishrink == 'true' }} - czicompress: ${{ github.event_name != 'pull_request' || steps.filter.outputs.czicompress == 'true' }} + czishrink: ${{ steps.result.outputs.czishrink }} + czicompress: ${{ steps.result.outputs.czicompress }} steps: # For pull requests it's not necessary to checkout the code - uses: dorny/paths-filter@v2 @@ -37,7 +37,15 @@ jobs: filters: | czishrink: - 'czishrink/**' + - '.github/**' + - '*.yml' czicompress: - '**czicompress**' - '.github/**' - '*.yml' + - id: result + run: | + echo "czishrink=${{ github.event_name != 'pull_request' || steps.filter.outputs.czishrink == 'true' }}" + echo "czicompress=${{ github.event_name != 'pull_request' || steps.filter.outputs.czicompress == 'true' }}" + echo "czishrink=${{ github.event_name != 'pull_request' || steps.filter.outputs.czishrink == 'true' }}" >> "$GITHUB_OUTPUT" + echo "czicompress=${{ github.event_name != 'pull_request' || steps.filter.outputs.czicompress == 'true' }}" >> "$GITHUB_OUTPUT"