Skip to content

Commit

Permalink
bump 4
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Dec 20, 2023
1 parent 60c6894 commit ea65955
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/manage-integration-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,30 @@ jobs:
});
return check.data.id;
update-check:
needs: [create-check]
runs-on: ubuntu-latest
steps:
- name: Update check result
uses: actions/github-script@v6
if: ${{ github.context.payload.action == 'completed' }}
if: ${{ always() && github.context.payload.action == 'completed' }}
with:
script: |
// Update the check run
const checkId = ${{ needs.create-check.outputs.check_id }};
const head_sha = context.payload.workflow_run.head_sha;
const runs = await github.paginate(github.rest.checks.listForRef, {
...context.repo,
ref: head_sha,
check_name: "integration-test-result",
})
core.debug(`integration-test-result check runs: ${JSON.stringify(runs, null, 2)}`);
const checkId = runs.sort((a, b) => Date.parse(b.started_at) - Date.parse(a.started_at))[0];
if (!checkId) {
core.setFailed(`No integration-test-result check found for commit ${head_sha}`);
return;
}
await github.checks.update({
...context.repo
check_run_id: checkId,
status: "completed",
conclusion: github.event.workflow_run.conclusion,
conclusion: context.payload.workflow_run.conclusion,
});

0 comments on commit ea65955

Please sign in to comment.