Skip to content

Adapt PR status labels (Move) #2294

Adapt PR status labels (Move)

Adapt PR status labels (Move) #2294

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@v7
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 }}