Skip to content

Commit 769af05

Browse files
committed
Handle member errors
With this change, a single member failure does not cause the entire loop to fail. Instead, a new issue is created that contains all the failed members
1 parent 0f946ad commit 769af05

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/ecosystem-action.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,36 @@ jobs:
2626
#get the sha or the latest main
2727
QUARKUS_SHA=$(git ls-remote https://github.com/quarkusio/quarkus main | awk '{print $1;}')
2828
29+
FAILED_MEMBERS=""
2930
for member in */ ; do
30-
./run-for-member "${member}" "${QUARKUS_SHA}" "${ECOSYSTEM_CI_TOKEN}"
31+
if ! ./run-for-member "${member}" "${QUARKUS_SHA}" "${ECOSYSTEM_CI_TOKEN}"; then
32+
echo "::warning::run-for-member failed for ${member}"
33+
FAILED_MEMBERS="${FAILED_MEMBERS} ${member}"
34+
fi
3135
done
36+
37+
if [ -n "${FAILED_MEMBERS}" ]; then
38+
echo "The following members failed:${FAILED_MEMBERS}"
39+
echo "failed_members=${FAILED_MEMBERS}" >> "$GITHUB_OUTPUT"
40+
fi
41+
id: launch
3242
env:
3343
ECOSYSTEM_CI_TOKEN: ${{ secrets.ECOSYSTEM_CI_TOKEN }}
44+
45+
- name: Report failures
46+
if: steps.launch.outputs.failed_members != ''
47+
uses: actions/github-script@v7
48+
with:
49+
github-token: ${{ secrets.ECOSYSTEM_CI_TOKEN }}
50+
script: |
51+
const failedMembers = '${{ steps.launch.outputs.failed_members }}'.trim().split(/\s+/);
52+
const body = `The following members failed to have their CI launched during the [workflow run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}):\n\n` +
53+
failedMembers.map(m => `- \`${m}\``).join('\n') +
54+
`\n\nPlease investigate the failures.`;
55+
await github.rest.issues.create({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
title: `Ecosystem CI launch failures - ${new Date().toISOString().split('T')[0]}`,
59+
body: body,
60+
labels: ['ci-failure']
61+
});

0 commit comments

Comments
 (0)