3131 - riscv64-musl-linux
3232 types :
3333 - completed
34- branches :
35- - release
3634
3735permissions :
3836 contents : write
4442 # Only run if the triggering workflow succeeded AND it ran on the release branch
4543 if : ${{ github.event.workflow_run.head_branch == 'release' && github.event.workflow_run.conclusion == 'success' }}
4644 steps :
45+ - name : Log trigger information
46+ run : |
47+ echo "Triggered by workflow: ${{ github.event.workflow_run.name }}"
48+ echo "Workflow status: ${{ github.event.workflow_run.conclusion }}"
49+ echo "Branch: ${{ github.event.workflow_run.head_branch }}"
50+ echo "Commit SHA: ${{ github.event.workflow_run.head_sha }}"
51+
4752 - name : Check all workflow statuses
4853 id : check-all
4954 uses : actions/github-script@v7
@@ -104,27 +109,42 @@ jobs:
104109
105110 const failed = [];
106111 const pending = [];
112+ const succeeded = [];
107113
108114 for (const name of target_workflows) {
109115 const run = latest_runs[name];
110- if (!run || run.status !== 'completed') {
116+ if (!run) {
117+ console.log(` ${name}: NO RUN FOUND`);
118+ pending.push(name);
119+ } else if (run.status !== 'completed') {
120+ console.log(` ${name}: ${run.status}`);
111121 pending.push(name);
112122 } else if (run.conclusion !== 'success') {
123+ console.log(` ${name}: completed with ${run.conclusion}`);
113124 failed.push(name);
125+ } else {
126+ console.log(` ${name}: success`);
127+ succeeded.push(name);
114128 }
115129 }
116130
131+ console.log(`\nSummary: ${succeeded.length} succeeded, ${pending.length} pending, ${failed.length} failed`);
132+
117133 if (pending.length > 0) {
118- console.log(`Waiting for other workflows to complete: ${pending.join(', ')}`);
134+ console.log(`Waiting for ${pending.length} workflows to complete: ${pending.join(', ')}`);
135+ core.setOutput("ready", "false");
136+ core.notice(`Release skipped: waiting for ${pending.length} workflows to complete`);
119137 return; // Exit successfully but do nothing; wait for next trigger
120138 }
121139
122140 if (failed.length > 0) {
123141 core.setFailed(`One or more workflows failed: ${failed.join(', ')}`);
142+ core.setOutput("ready", "false");
124143 return;
125144 }
126145
127146 console.log("All target workflows passed successfully!");
147+ core.notice("All required workflows passed - creating release");
128148 core.setOutput("ready", "true");
129149
130150 - name : Perform Release
@@ -136,7 +156,14 @@ jobs:
136156
137157 - name : Get Version
138158 if : steps.check-all.outputs.ready == 'true'
139- run : echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
159+ run : |
160+ if [ ! -f VERSION ]; then
161+ echo "ERROR: VERSION file not found"
162+ exit 1
163+ fi
164+ VERSION=$(cat VERSION)
165+ echo "Creating release for version: $VERSION"
166+ echo "VERSION=$VERSION" >> $GITHUB_ENV
140167
141168 - name : Get Release Details
142169 if : steps.check-all.outputs.ready == 'true'
0 commit comments