Skip to content

Adds labels

Adds labels #3772

Workflow file for this run

name: Adds labels
on:
workflow_run:
workflows: ["Rust CI"]
types:
- completed
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
jobs:
check:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add labels
continue-on-error: true
run: |
PR_NUMBERS=$(jq --raw-output '.workflow_run.pull_requests[].number' "$GITHUB_EVENT_PATH")
if [ -z "$PR_NUMBERS" ]; then
echo "No PR found for this run. Exiting."
exit 0
fi
for PR_NUMBER in $PR_NUMBERS; do
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then
gh pr edit "$PR_NUMBER" --remove-label "S-awaiting-pass-CI"
else
gh pr edit "$PR_NUMBER" --add-label "S-awaiting-pass-CI"
fi
done