Skip to content

Commit

Permalink
Set commit status manually
Browse files Browse the repository at this point in the history
Signed-off-by: kouki <[email protected]>
  • Loading branch information
kmdkuk committed Dec 14, 2023
1 parent e07f91a commit d6c8ed7
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/ci-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Set pending to commit status
uses: myrotvorets/set-commit-status-action@38f3f27c7d52fb381273e95542f07f0fba301307 # v2.0.0
with:
sha: ${{ github.sha }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/${{ github.sha }} \
-f state='pending' \
-f target_url='${{github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }}' \
-f context='${{ github.workflow }}'
extract-github-ref:
name: extract github.ref
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -136,7 +144,14 @@ jobs:
echo "result=success" >> $GITHUB_OUTPUT
fi
- name: Set final commit status
uses: myrotvorets/set-commit-status-action@38f3f27c7d52fb381273e95542f07f0fba301307 # v2.0.0
with:
sha: ${{ github.sha }}
status: ${{ steps.final-status.outputs.result }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/${{ github.sha }} \
-f state='${{ steps.final-status.outputs.result }}' \
-f target_url='${{github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }}' \
-f context='${{ github.workflow }}'

0 comments on commit d6c8ed7

Please sign in to comment.