Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Automatically remove committee review label from closed PRs
name: Automatically remove lifecycle labels from closed PRs

"on":
pull_request:
Expand All @@ -17,15 +17,29 @@ jobs:
labeler:
if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.type
!= 'Bot'
name: Remove committee review label from closed PR
name: Remove lifecycle labels from closed PR
permissions:
pull-requests: write # Needed to remove the label

runs-on: ubuntu-latest
steps:
- env:
EVENT_ACTION: ${{ github.event.action }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_REPO: ${{ github.repository }}
PR_URL: ${{ github.event.pull_request.html_url }}
name: Remove committee review label from closed PR
run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO"
name: Remove lifecycle labels from closed PR
run: |-
set -euo pipefail

labels=("awaiting committee review")
if [ "$EVENT_ACTION" = "closed" ]; then
labels+=("sync" "conflict")
fi

args=()
for label in "${labels[@]}"; do
args+=(--remove-label "$label")
done

gh pr edit "$PR_URL" "${args[@]}" --repo "$PR_REPO"