Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / .github / workflows / ofborg-pending.yml
blobb5e0a7c46c8c172517237afb545d9b4e0b249cb4
1 name: "Set pending OfBorg status"
2 on:
3   pull_request_target:
5 # Sets the ofborg-eval status to "pending" to signal that we are waiting for
6 # OfBorg even if it is running late. The status will be overwritten by OfBorg
7 # once it starts evaluation.
9 # WARNING:
10 # When extending this action, be aware that $GITHUB_TOKEN allows (restricted) write access to
11 # the GitHub repository. This means that it should not evaluate user input in a
12 # way that allows code injection.
14 permissions:
15   contents: read
17 jobs:
18   action:
19     if: github.repository_owner == 'NixOS'
20     permissions:
21       statuses: write
22     runs-on: ubuntu-latest
23     steps:
24     - name: "Set pending OfBorg status"
25       env:
26         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27       run: |
28         curl \
29           -X POST \
30           -H "Accept: application/vnd.github.v3+json" \
31           -H "Authorization: Bearer $GITHUB_TOKEN" \
32           -d '{"context": "ofborg-eval", "state": "pending", "description": "Waiting for OfBorg..."}' \
33           "https://api.github.com/repos/NixOS/nixpkgs/commits/${{ github.event.pull_request.head.sha }}/statuses"