-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Expand file tree
/
Copy pathon-pr-changes-requested-move-labels.yml
More file actions
41 lines (39 loc) · 1.5 KB
/
on-pr-changes-requested-move-labels.yml
File metadata and controls
41 lines (39 loc) · 1.5 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
41
name: Adapt PR status labels (Move)
on:
workflow_run:
workflows: [ "Adapt PR status labels (Check)" ]
types: [ completed ]
jobs:
apply-labels:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-slim
permissions:
actions: write
contents: write
pull-requests: write
steps:
- name: Download artifact from triggering run
uses: actions/download-artifact@v8
with:
run-id: ${{ github.event.workflow_run.id }}
name: pr_number
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Check for pr_number.txt
id: check
run: |
if [ -f pr_number.txt ]; then
echo "continue=true" >> "$GITHUB_OUTPUT"
echo "pr_number=$(cat pr_number.txt)" >> "$GITHUB_OUTPUT"
echo "pr_number=$(cat pr_number.txt)" >> "$GITHUB_STEP_SUMMARY"
else
echo "continue=false" >> "$GITHUB_OUTPUT"
echo "No PR number existing" >> "$GITHUB_STEP_SUMMARY"
fi
- name: Apply label operations
if: steps.check.outputs.continue == 'true'
shell: bash -euxo pipefail {0}
run: >
gh issue --repo ${{ github.repository }} edit ${{ steps.check.outputs.pr_number }} --remove-label "status: ready-for-review,status: awaiting-second-review,status: to-be-merged,status: no-bot-comments" --add-label "status: changes-required"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}