Skip to content

Commit d750109

Browse files
authored
ci: Update versions workflow to capture error (#2694)
1 parent 4fd9ade commit d750109

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/versions.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,22 @@ jobs:
3434
git diff
3535
# Get the links to the changelogs of the updated versions and make them
3636
# available to the reviewers
37-
{
38-
echo "new_changelogs<<EOF"
39-
scripts/get-new-changelogs.sh
40-
echo EOF
41-
} >> "$GITHUB_OUTPUT"
37+
# 1) Start the multiline output, unconditionally
38+
echo "new_changelogs<<EOF" >> "$GITHUB_OUTPUT"
39+
40+
# 2) Run the changelog script, capture its exit code,
41+
# and append its stdout to the output.
42+
scripts/get-new-changelogs.sh >> "$GITHUB_OUTPUT"
43+
script_rc=$?
44+
45+
# 3) Close the delimiter so Actions can parse the value.
46+
echo "EOF" >> "$GITHUB_OUTPUT"
47+
48+
# 4) If the script failed, re-exit with its code to fail the job.
49+
if [ $script_rc -ne 0 ]; then
50+
echo "::error::get-new-changelogs.sh failed with exit code $script_rc"
51+
exit $script_rc
52+
fi
4253
if: matrix.branch == 'main'
4354
- name: Update jsonnet dependencies
4455
run: |

0 commit comments

Comments
 (0)