Skip to content

Commit 4880b47

Browse files
authored
ci: auto-convert PR to draft on changes requested (#440)
1 parent 5b6b1b2 commit 4880b47

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Draft on Changes Requested
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Record Changes Requested"]
6+
types: [completed]
7+
8+
permissions: {}
9+
10+
jobs:
11+
get-pr:
12+
if: github.event.workflow_run.conclusion == 'success'
13+
runs-on: ubuntu-latest
14+
permissions:
15+
actions: read
16+
outputs:
17+
pr_number: ${{ steps.pr.outputs.number }}
18+
steps:
19+
- uses: actions/download-artifact@v4
20+
with:
21+
name: pr-info
22+
run-id: ${{ github.event.workflow_run.id }}
23+
github-token: ${{ github.token }}
24+
- id: pr
25+
run: echo "number=$(cat pr_number.txt)" >> "$GITHUB_OUTPUT"
26+
27+
draft:
28+
needs: get-pr
29+
uses: DIRACGrid/.github/.github/workflows/draft-on-changes-requested.yml@main
30+
with:
31+
pr_number: ${{ fromJSON(needs.get-pr.outputs.pr_number) }}
32+
secrets:
33+
token: ${{ secrets.DRAFT_PAT }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Record Changes Requested
2+
3+
on:
4+
pull_request_review:
5+
types: [submitted]
6+
7+
jobs:
8+
record:
9+
if: github.event.review.state == 'changes_requested'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- run: echo "${{ github.event.pull_request.number }}" > pr_number.txt
13+
- uses: actions/upload-artifact@v4
14+
with:
15+
name: pr-info
16+
path: pr_number.txt

0 commit comments

Comments
 (0)