Skip to content

Commit

Permalink
ci: Give up, simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jun 26, 2024
1 parent 027c3fa commit 4768de3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,9 @@ jobs:
results: ${{ runner.os }}-r${{ matrix.r }}

- uses: ./.github/workflows/update-status
if: success()
if: always()
with:
sha: ${{ needs.rcc-smoke.outputs.sha }}
state: success

- uses: ./.github/workflows/update-status
if: failure()
with:
sha: ${{ needs.rcc-smoke.outputs.sha }}
state: failure

suggests-matrix:
runs-on: ubuntu-22.04
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/update-status/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
runs:
using: "composite"
steps:
# It's difficult to get the URL of the current job.
# The /jobs API and/or the `github` context are misaligned.
# The duckdbneo repository contains several failed attempts.
- run: |
set -x
if [ -n ${{ inputs.sha }} ]; then
Expand All @@ -20,7 +23,12 @@ runs:
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/${{ inputs.sha }} \
-f "state=${{ inputs.state }}" -f "context=actions-sync"
-f "state=${{ job.status }}" -f "description=${{ github.job_id }}" -f "context=actions-sync"
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}
html_url=$(gh api \
-H "Accept: application/vnd.github+json" \
Expand All @@ -29,10 +37,6 @@ runs:
echo $html_url
html_url=$(curl -f -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ github.token }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq . | tee /dev/stderr | jq '.jobs[] | select (.name == ${{ github.job }}) | .html_url')
echo $html_url
# curl -f -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ github.token }}" https://api.github.com/repos/${{ github.repository }}/statuses/${{ inputs.sha }} -d '{"state": "${{ inputs.state }}", "context": "${{ github.workflow }} / ${{ github.job }}", "target_url": '${html_url}' }'
fi
shell: bash

0 comments on commit 4768de3

Please sign in to comment.