diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index fe080564..73209f32 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -94,7 +94,7 @@ jobs: run: npm run postlint --ignore-scripts -ws -iwr --if-present - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: steps.check.outputs.check_id && always() with: token: ${{ secrets.GITHUB_TOKEN }} conclusion: ${{ job.status }} @@ -209,7 +209,7 @@ jobs: run: npm test --ignore-scripts -ws -iwr --if-present - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: steps.check.outputs.check_id && always() with: token: ${{ secrets.GITHUB_TOKEN }} conclusion: ${{ job.status }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fdbe74c..e7383d86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,7 @@ jobs: return commentId - name: Get Workflow Job uses: actions/github-script@v6 - if: steps.release.outputs.pr-number + if: steps.release.outputs.pr-sha id: check-output env: JOB_NAME: "Release" @@ -123,7 +123,7 @@ jobs: - name: Create Check uses: LouisBrunner/checks-action@v1.3.1 id: check - if: steps.release.outputs.pr-number + if: steps.release.outputs.pr-sha with: token: ${{ secrets.GITHUB_TOKEN }} status: in_progress @@ -180,7 +180,7 @@ jobs: echo "::set-output name=sha::$(git rev-parse HEAD)" - name: Get Workflow Job uses: actions/github-script@v6 - + if: steps.commit.outputs.sha id: check-output env: JOB_NAME: "Update - Release" @@ -214,7 +214,7 @@ jobs: - name: Create Check uses: LouisBrunner/checks-action@v1.3.1 id: check - + if: steps.commit.outputs.sha with: token: ${{ secrets.GITHUB_TOKEN }} status: in_progress @@ -223,7 +223,7 @@ jobs: output: ${{ steps.check-output.outputs.result }} - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: needs.release.outputs.check-id && always() with: token: ${{ secrets.GITHUB_TOKEN }} conclusion: ${{ job.status }} @@ -261,7 +261,7 @@ jobs: echo "::set-output name=result::$result" - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: needs.update.outputs.check-id && always() with: token: ${{ secrets.GITHUB_TOKEN }} conclusion: ${{ steps.needs-result.outputs.result }} diff --git a/lib/content/_step-checks.yml b/lib/content/_step-checks.yml index b1bf08c4..3eb8cc56 100644 --- a/lib/content/_step-checks.yml +++ b/lib/content/_step-checks.yml @@ -1,7 +1,7 @@ {{#if jobCheck.sha}} - name: Get Workflow Job uses: actions/github-script@v6 - {{#if jobCheck.if}}if: {{ jobCheck.if }}{{/if}} + if: {{ jobCheck.sha }} id: check-output env: JOB_NAME: "{{#if jobName}}{{ jobName }}{{else}}{{ jobCheck.name }}{{/if}}" @@ -21,7 +21,7 @@ const job = data.jobs.find(j => j.name.endsWith(jobName)) const jobUrl = job?.html_url - const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/{{ jobCheck.sha }}` + const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/$\{{ {{ jobCheck.sha }} }}` let summary = `This check is assosciated with ${shaUrl}\n\n` @@ -37,18 +37,18 @@ uses: LouisBrunner/checks-action@v1.3.1 {{#if jobCheck.sha}} id: check - {{#if jobCheck.if}}if: {{ jobCheck.if }}{{/if}} + if: {{ jobCheck.sha }} {{else}} - if: always() + if: {{#if jobCheck.id}}{{ jobCheck.id }}{{else}}steps.check.outputs.check_id{{/if}} && always() {{/if}} with: token: $\{{ secrets.GITHUB_TOKEN }} {{#if jobCheck.sha}} status: {{#if jobCheck.status}}{{ jobCheck.status }}{{else}}in_progress{{/if}} name: {{#if jobCheck.name}}{{ jobCheck.name }}{{else}}{{ jobName }}{{/if}}{{#if jobIsMatrix}} - $\{{ matrix.platform.name }} - $\{{ matrix.node-version }}{{/if}} - sha: {{ jobCheck.sha }} + sha: $\{{ {{ jobCheck.sha }} }} output: $\{{ steps.check-output.outputs.result }} {{else}} - conclusion: {{#if jobCheck.status}}{{ jobCheck.status }}{{else}}$\{{ job.status }}{{/if}} - check_id: {{#if jobCheck.id}}{{ jobCheck.id }}{{else}}$\{{ steps.check.outputs.check_id }}{{/if}} + conclusion: $\{{ {{#if jobCheck.status}}{{ jobCheck.status }}{{else}}job.status{{/if}} }} + check_id: $\{{ {{#if jobCheck.id}}{{ jobCheck.id }}{{else}}steps.check.outputs.check_id{{/if}} }} {{/if}} diff --git a/lib/content/ci-release.yml b/lib/content/ci-release.yml index e8620ab5..81582af3 100644 --- a/lib/content/ci-release.yml +++ b/lib/content/ci-release.yml @@ -21,7 +21,7 @@ jobs: lint-all: {{> job jobName="Lint All" - jobCheck=(obj sha="${{ inputs.check-sha }}" if="inputs.check-sha") + jobCheck=(obj sha="inputs.check-sha") jobCheckout=(obj ref="${{ inputs.ref }}") }} {{> stepLint jobRunFlags=allFlags }} @@ -30,7 +30,7 @@ jobs: test-all: {{> jobMatrix jobName="Test All" - jobCheck=(obj sha="${{ inputs.check-sha }}" if="inputs.check-sha") + jobCheck=(obj sha="inputs.check-sha") jobCheckout=(obj ref="${{ inputs.ref }}") }} {{> stepTest jobRunFlags=allFlags }} diff --git a/lib/content/release.yml b/lib/content/release.yml index dab6f383..e47fdbf7 100644 --- a/lib/content/release.yml +++ b/lib/content/release.yml @@ -64,7 +64,7 @@ jobs: } return commentId - {{> stepChecks jobCheck=(obj name="Release" sha="${{ steps.release.outputs.pr-sha }}" if="steps.release.outputs.pr-number") }} + {{> stepChecks jobCheck=(obj name="Release" sha="steps.release.outputs.pr-sha") }} update: needs: release @@ -92,8 +92,8 @@ jobs: git commit --all --amend --no-edit || true git push --force-with-lease echo "::set-output name=sha::$(git rev-parse HEAD)" - {{> stepChecks jobName="Update - Release" jobCheck=(obj sha="${{ steps.commit.outputs.sha }}" name="Release" )}} - {{> stepChecks jobCheck=(obj id="${{ needs.release.outputs.check-id }}" )}} + {{> stepChecks jobName="Update - Release" jobCheck=(obj sha="steps.commit.outputs.sha" name="Release" )}} + {{> stepChecks jobCheck=(obj id="needs.release.outputs.check-id" )}} ci: name: CI - Release @@ -119,7 +119,7 @@ jobs: result="success" fi echo "::set-output name=result::$result" - {{> stepChecks jobCheck=(obj id="${{ needs.update.outputs.check-id }}" status="${{ steps.needs-result.outputs.result }}") }} + {{> stepChecks jobCheck=(obj id="needs.update.outputs.check-id" status="steps.needs-result.outputs.result") }} post-release: needs: release diff --git a/tap-snapshots/test/apply/source-snapshots.js.test.cjs b/tap-snapshots/test/apply/source-snapshots.js.test.cjs index 6999c9db..c289f6dc 100644 --- a/tap-snapshots/test/apply/source-snapshots.js.test.cjs +++ b/tap-snapshots/test/apply/source-snapshots.js.test.cjs @@ -301,7 +301,7 @@ jobs: run: npm run postlint --ignore-scripts - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -416,7 +416,7 @@ jobs: run: npm test --ignore-scripts - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -891,7 +891,7 @@ jobs: return commentId - name: Get Workflow Job uses: actions/github-script@v6 - if: steps.release.outputs.pr-number + if: steps.release.outputs.pr-sha id: check-output env: JOB_NAME: "Release" @@ -925,7 +925,7 @@ jobs: - name: Create Check uses: LouisBrunner/checks-action@v1.3.1 id: check - if: steps.release.outputs.pr-number + if: steps.release.outputs.pr-sha with: token: \${{ secrets.GITHUB_TOKEN }} status: in_progress @@ -982,7 +982,7 @@ jobs: echo "::set-output name=sha::$(git rev-parse HEAD)" - name: Get Workflow Job uses: actions/github-script@v6 - + if: steps.commit.outputs.sha id: check-output env: JOB_NAME: "Update - Release" @@ -1016,7 +1016,7 @@ jobs: - name: Create Check uses: LouisBrunner/checks-action@v1.3.1 id: check - + if: steps.commit.outputs.sha with: token: \${{ secrets.GITHUB_TOKEN }} status: in_progress @@ -1025,7 +1025,7 @@ jobs: output: \${{ steps.check-output.outputs.result }} - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: needs.release.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -1063,7 +1063,7 @@ jobs: echo "::set-output name=result::$result" - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: needs.update.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ steps.needs-result.outputs.result }} @@ -1903,7 +1903,7 @@ jobs: run: npm run postlint --ignore-scripts -ws -iwr --if-present - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -2018,7 +2018,7 @@ jobs: run: npm test --ignore-scripts -ws -iwr --if-present - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -2499,7 +2499,7 @@ jobs: return commentId - name: Get Workflow Job uses: actions/github-script@v6 - if: steps.release.outputs.pr-number + if: steps.release.outputs.pr-sha id: check-output env: JOB_NAME: "Release" @@ -2533,7 +2533,7 @@ jobs: - name: Create Check uses: LouisBrunner/checks-action@v1.3.1 id: check - if: steps.release.outputs.pr-number + if: steps.release.outputs.pr-sha with: token: \${{ secrets.GITHUB_TOKEN }} status: in_progress @@ -2590,7 +2590,7 @@ jobs: echo "::set-output name=sha::$(git rev-parse HEAD)" - name: Get Workflow Job uses: actions/github-script@v6 - + if: steps.commit.outputs.sha id: check-output env: JOB_NAME: "Update - Release" @@ -2624,7 +2624,7 @@ jobs: - name: Create Check uses: LouisBrunner/checks-action@v1.3.1 id: check - + if: steps.commit.outputs.sha with: token: \${{ secrets.GITHUB_TOKEN }} status: in_progress @@ -2633,7 +2633,7 @@ jobs: output: \${{ steps.check-output.outputs.result }} - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: needs.release.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -2671,7 +2671,7 @@ jobs: echo "::set-output name=result::$result" - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: needs.update.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ steps.needs-result.outputs.result }} @@ -3513,7 +3513,7 @@ jobs: run: npm run postlint --ignore-scripts -ws -iwr --if-present - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -3628,7 +3628,7 @@ jobs: run: npm test --ignore-scripts -ws -iwr --if-present - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -3851,7 +3851,7 @@ jobs: return commentId - name: Get Workflow Job uses: actions/github-script@v6 - if: steps.release.outputs.pr-number + if: steps.release.outputs.pr-sha id: check-output env: JOB_NAME: "Release" @@ -3885,7 +3885,7 @@ jobs: - name: Create Check uses: LouisBrunner/checks-action@v1.3.1 id: check - if: steps.release.outputs.pr-number + if: steps.release.outputs.pr-sha with: token: \${{ secrets.GITHUB_TOKEN }} status: in_progress @@ -3942,7 +3942,7 @@ jobs: echo "::set-output name=sha::$(git rev-parse HEAD)" - name: Get Workflow Job uses: actions/github-script@v6 - + if: steps.commit.outputs.sha id: check-output env: JOB_NAME: "Update - Release" @@ -3976,7 +3976,7 @@ jobs: - name: Create Check uses: LouisBrunner/checks-action@v1.3.1 id: check - + if: steps.commit.outputs.sha with: token: \${{ secrets.GITHUB_TOKEN }} status: in_progress @@ -3985,7 +3985,7 @@ jobs: output: \${{ steps.check-output.outputs.result }} - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: needs.release.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ job.status }} @@ -4023,7 +4023,7 @@ jobs: echo "::set-output name=result::$result" - name: Conclude Check uses: LouisBrunner/checks-action@v1.3.1 - if: always() + if: needs.update.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} conclusion: \${{ steps.needs-result.outputs.result }}