|
38 | 38 | types: [completed] |
39 | 39 | workflow_dispatch: |
40 | 40 |
|
41 | | -concurrency: |
42 | | - group: python-wheels-upstreaming-controller |
43 | | - cancel-in-progress: false |
44 | | - |
45 | 41 | permissions: |
46 | 42 | contents: read |
47 | 43 | issues: read |
48 | 44 |
|
49 | 45 | jobs: |
| 46 | + # Fast receipt only. This job has no needs and no concurrency group, so a |
| 47 | + # queued reconciliation run cannot delay acknowledgement. Command parsing, |
| 48 | + # authority checks, rejection feedback and state changes remain in reconcile. |
| 49 | + acknowledge-command: |
| 50 | + if: github.event_name == 'issue_comment' && github.event.issue.pull_request == null |
| 51 | + runs-on: ubuntu-latest |
| 52 | + timeout-minutes: 2 |
| 53 | + permissions: |
| 54 | + contents: read |
| 55 | + steps: |
| 56 | + - uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 |
| 57 | + id: control-token |
| 58 | + with: |
| 59 | + client-id: ${{ vars.RISEPROJECT_APP_CLIENT_ID }} |
| 60 | + private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} |
| 61 | + owner: riseproject-dev |
| 62 | + repositories: python-wheels |
| 63 | + permission-issues: write |
| 64 | + - name: Acknowledge a visible upstreaming command |
| 65 | + env: |
| 66 | + GH_TOKEN: ${{ steps.control-token.outputs.token }} |
| 67 | + COMMENT_ID: ${{ github.event.comment.id }} |
| 68 | + COMMENT_BODY: ${{ github.event.comment.body }} |
| 69 | + run: | |
| 70 | + set -euo pipefail |
| 71 | + first=$(printf '%s\n' "$COMMENT_BODY" | awk 'NF { print; exit }') |
| 72 | + [[ "$first" == /upstreaming\ * ]] || exit 0 |
| 73 | + reactions=$(gh api "/repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID/reactions?per_page=100") |
| 74 | + jq -e 'any(.[]; .content == "+1" and .user.login == "riseproject-dev[bot]")' \ |
| 75 | + <<<"$reactions" >/dev/null || \ |
| 76 | + gh api -X POST "/repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID/reactions" \ |
| 77 | + -f content='+1' >/dev/null |
| 78 | +
|
50 | 79 | # Cheap filter: unsupported events, missing labels and comments that are |
51 | 80 | # not commands never reach the tick. |
52 | 81 | filter: |
@@ -102,6 +131,9 @@ jobs: |
102 | 131 | needs: filter |
103 | 132 | runs-on: ubuntu-latest |
104 | 133 | timeout-minutes: 15 |
| 134 | + concurrency: |
| 135 | + group: python-wheels-upstreaming-controller |
| 136 | + cancel-in-progress: false |
105 | 137 | environment: upstreaming-state |
106 | 138 | permissions: |
107 | 139 | contents: read |
|
0 commit comments