Skip to content

Commit 4fe3023

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 cf19ed4 commit 4fe3023

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

0 commit comments

Comments
 (0)