Adapt PR status labels (Move) #525
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-latest | |
| permissions: | |
| actions: write | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Download artifact from triggering run | |
| uses: actions/download-artifact@v6 | |
| 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" | |
| else | |
| echo "continue=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Apply label operations | |
| if: steps.check.outputs.continue == 'true' | |
| run: | | |
| gh issue --repo ${{ github.repository }} edit ${{ steps.check.outputs.pr_number }} --remove-label "status: ready-for-review" | |
| gh issue --repo ${{ github.repository }} edit ${{ steps.check.outputs.pr_number }} --remove-label "status: awaiting-second-review" | |
| gh issue --repo ${{ github.repository }} edit ${{ steps.check.outputs.pr_number }} --add-label "status: changes-required" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |