Skip to content

Commit 3f9ff20

Browse files
committed
Address incorrect calling of reusable workflow
1 parent fa814ba commit 3f9ff20

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

.github/workflows/update-release-status.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ permissions:
2222
jobs:
2323
validate-check-runs:
2424
runs-on: ubuntu-latest
25+
outputs:
26+
status: ${{ steps.set-output.outputs.status }}
27+
check-run-head-sha: ${{ steps.set-output.outputs.check-run-head-sha }}
2528
steps:
2629
- name: Determine check run head SHA
2730
env:
@@ -93,12 +96,6 @@ jobs:
9396
echo "CHECK_RUNS_FAILED=$failed" >> "$GITHUB_ENV"
9497
echo "CHECK_RUNS_PENDING=$pending" >> "$GITHUB_ENV"
9598
96-
- name: Finalize release
97-
if: env.CHECK_RUNS_PENDING == '0' && env.CHECK_RUN_STATUS != 'completed'
98-
uses: ./.github/workflows/update-release.yml
99-
with:
100-
ref: ${{ env.CHECK_RUN_HEAD_SHA }}
101-
10299
- name: Conclude release status
103100
if: env.CHECK_RUNS_PENDING == '0' && env.CHECK_RUN_STATUS != 'completed'
104101
env:
@@ -124,4 +121,23 @@ jobs:
124121
--header "X-GitHub-Api-Version: 2022-11-28" \
125122
--input - \
126123
/repos/$GITHUB_REPOSITORY/check-runs/$CHECK_RUN_ID
127-
124+
125+
- name: Set output
126+
id: set-output
127+
run: |
128+
if [[ "$CHECK_RUNS_PENDING" == "0" ]]; then
129+
echo "status=completed" >> "$GITHUB_OUTPUT"
130+
else
131+
echo "status=in_progress" >> "$GITHUB_OUTPUT"
132+
fi
133+
134+
echo "check-run-head-sha=$CHECK_RUN_HEAD_SHA" >> "$GITHUB_OUTPUT"
135+
136+
update-release:
137+
needs: validate-check-runs
138+
if: needs.validate-check-runs.outputs.status == 'completed'
139+
uses: ./.github/workflows/update-release.yml
140+
with:
141+
head-sha: ${{ needs.validate-check-runs.outputs.check-run-head-sha }}
142+
secrets:
143+
RELEASE_ENGINEERING_TOKEN: ${{ secrets.RELEASE_ENGINEERING_TOKEN }}

.github/workflows/update-release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ on:
1414
description: |
1515
The head SHA of the release PR to use for finalizing the release.
1616
required: true
17-
17+
secrets:
18+
RELEASE_ENGINEERING_TOKEN:
19+
description: |
20+
The token to use for accessing the release engineering repository.
21+
required: true
1822
env:
1923
HEAD_SHA: ${{ inputs.head-sha }}
2024

0 commit comments

Comments
 (0)