Skip to content

Commit 7420a5e

Browse files
committed
ci: publish: update commit status
A 'Publish core' status is added that shows the result of the workflow: - a green check ('success') if the core is published successfully - a yellow dot ('pending') if the core is OK but not published (a PR) - a red cross ('failure') if an error occurred during the workflow
1 parent 0e2c7e5 commit 7420a5e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Diff for: .github/workflows/package_core.yml

+27
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,30 @@ jobs:
197197
with:
198198
name: ${{ env.PACKAGE_INDEX_JSON }}
199199
path: ${{ env.PACKAGE_INDEX_JSON }}
200+
201+
set-final-status:
202+
name: Set workflow result
203+
runs-on: ubuntu-latest
204+
needs:
205+
- package-core
206+
- test-core
207+
- publish-artifacts
208+
if: ${{ success() || failure() || needs.publish-artifacts.result == 'skipped' }}
209+
permissions:
210+
statuses: write
211+
steps:
212+
- name: Define commit status
213+
run: |
214+
if [ "${{ needs.publish-artifacts.result }}" == "failure" ] ||
215+
[ "${{ needs.test-core.result }}" == "failure" ]; then
216+
echo "STATUS=failure" >> "$GITHUB_ENV"
217+
elif [ "${{ needs.publish-artifacts.result }}" == "skipped" ]; then
218+
echo "STATUS=pending" >> "$GITHUB_ENV"
219+
else
220+
echo "STATUS=success" >> "$GITHUB_ENV"
221+
fi
222+
- name: Set commit status
223+
uses: myrotvorets/[email protected]
224+
with:
225+
status: ${{ env.STATUS }}
226+
context: "Publish core"

0 commit comments

Comments
 (0)