Skip to content

Commit

Permalink
Address incorrect calling of reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rvermeulen committed Sep 20, 2023
1 parent e6619de commit e9b5131
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/update-release-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ permissions:
jobs:
validate-check-runs:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.set-output.outputs.status }}
check-run-head-sha: ${{ steps.set-output.outputs.check-run-head-sha }}
steps:
- name: Determine check run head SHA
env:
Expand Down Expand Up @@ -93,12 +96,6 @@ jobs:
echo "CHECK_RUNS_FAILED=$failed" >> "$GITHUB_ENV"
echo "CHECK_RUNS_PENDING=$pending" >> "$GITHUB_ENV"
- name: Finalize release
if: env.CHECK_RUNS_PENDING == '0' && env.CHECK_RUN_STATUS != 'completed'
uses: ./.github/workflows/update-release.yml
with:
ref: ${{ env.CHECK_RUN_HEAD_SHA }}

- name: Conclude release status
if: env.CHECK_RUNS_PENDING == '0' && env.CHECK_RUN_STATUS != 'completed'
env:
Expand All @@ -124,4 +121,23 @@ jobs:
--header "X-GitHub-Api-Version: 2022-11-28" \
--input - \
/repos/$GITHUB_REPOSITORY/check-runs/$CHECK_RUN_ID
- name: Set output
id: set-output
run: |
if [[ "$CHECK_RUNS_PENDING" == "0" ]]; then
echo "status=completed" >> "$GITHUB_OUTPUT"
else
echo "status=in_progress" >> "$GITHUB_OUTPUT"
fi
echo "check-run-head-sha=$CHECK_RUN_HEAD_SHA" >> "$GITHUB_OUTPUT"
update-release:
needs: validate-check-runs
if: needs.validate-check-runs.outputs.status == 'completed'
uses: ./.github/workflows/update-release.yml
with:
head-sha: ${{ needs.validate-check-runs.outputs.check-run-head-sha }}
secrets:
RELEASE_ENGINEERING_TOKEN: ${{ secrets.RELEASE_ENGINEERING_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/update-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ on:
description: |
The head SHA of the release PR to use for finalizing the release.
required: true

secrets:
RELEASE_ENGINEERING_TOKEN:
description: |
The token to use for accessing the release engineering repository.
required: true
env:
HEAD_SHA: ${{ inputs.head-sha }}

Expand Down

0 comments on commit e9b5131

Please sign in to comment.