forked from Submitty/Submitty
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1.39 KB
/
move_to_in_review.yml
File metadata and controls
40 lines (35 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Move PR to In Review
on:
pull_request_target:
types:
- review_requested
env:
PR_ID: ${{ github.event.pull_request.number }}
jobs:
move-to-in-review:
name: Move to In Review
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PEM }}
- name: Get PR project ID
id: get-pr-id
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
PR_PROJECT_ID="$(gh project item-list -L 9999 --owner Submitty 1 --format json --jq "[.items[] | {id, labels, status, title: .content.title, repo: .content.repository, number: .content.number}] | .[] | select(.number == "$PR_ID").id")"
echo "pr-project-id="${PR_PROJECT_ID:?}"" >> "$GITHUB_OUTPUT"
- name: Checkout the repo
uses: actions/checkout@v5
- name: Move PR to In Review
if: ${{ ! github.event.pull_request.draft }}
env:
PR_PROJECT_ID: ${{ steps.get-pr-id.outputs.pr-project-id }}
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
source .github/bin/board_automation_helper.sh
gh project item-edit --project-id "$PROJECT_ID" --id "$PR_PROJECT_ID" --field-id "$STATUS_FIELD_ID" --single-select-option-id "$IN_REVIEW_ID"