Skip to content

Commit

Permalink
add github action to wait for ofborg
Browse files Browse the repository at this point in the history
In case ofborg is down this will not mark the CI as green.
Also if other github actions are used and pass
checks will be still marked as pending even if other other github
actions have passed.
  • Loading branch information
Mic92 committed Jul 21, 2020
1 parent 622150e commit 4f95d1f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/wait-ofborg.yml
@@ -0,0 +1,28 @@
name: "Wait for ofborg"
on:
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Wait for ofborg CI
run: |
# wait for ~10min
set -x
for i in $(seq 120); do
res=$(curl --silent \
-H "Accept: application/vnd.github.antiope-preview+json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
"https://api.github.com/repos/NixOS/nixpkgs/commits/${COMMIT}/check-runs" | \
jq ".check_runs | map(.app) | map(.id) | contains([${OFBORG_APP_ID}])")
if [[ "$res" == "true" ]]; then
exit 0
fi
sleep 5
done
echo "Timeout!"
exit 1
env:
GITHUB_TOKEN: ${{ github.token }}
COMMIT: ${{ github.event.pull_request.head.sha }}
OFBORG_APP_ID: 20500

0 comments on commit 4f95d1f

Please sign in to comment.