Skip to content
Merged
Show file tree
Hide file tree
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
59 changes: 10 additions & 49 deletions .github/workflows/PRLabeler.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,15 @@
name: Checkbox Labeler

# Thin caller. The implementation lives ONCE, in QAtlasHub/.github (public, callable from any
# owner), so the next breakage is one commit there instead of one PR per repo — this file used
# to be a hand-rolled `gh pr edit` script, which GitHub's Projects-classic sunset broke in
# every repo at once on 2026-07-28.
name: PR Labeler
on:
pull_request:
types: [opened, edited]

types: [opened, edited, synchronize, reopened]
permissions:
contents: read
pull-requests: write
issues: write # required for gh label create

issues: write # addLabels / createLabel are issue-scoped, even on a PR
jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Update Labels based on Checkboxes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BODY: ${{ github.event.pull_request.body }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
# Ensure all labels exist (--force updates color/description if already present)
gh label create "enhancement" --repo "$REPO" --color "a2eeef" --force
gh label create "bug" --repo "$REPO" --color "d73a4a" --force
gh label create "performance" --repo "$REPO" --color "e4e669" --force
gh label create "documentation" --repo "$REPO" --color "0075ca" --force
gh label create "chore" --repo "$REPO" --color "e8e8e8" --force
gh label create "breaking" --repo "$REPO" --color "b60205" --force

if echo "$PR_BODY" | grep -qi "\- \[x\].*Feature"; then
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "enhancement"
fi

if echo "$PR_BODY" | grep -qi "\- \[x\].*Bug Fix"; then
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "bug"
fi

if echo "$PR_BODY" | grep -qi "\- \[x\].*Performance"; then
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "performance"
fi

if echo "$PR_BODY" | grep -qi "\- \[x\].*Documentation"; then
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "documentation"
fi

if echo "$PR_BODY" | grep -qi "\- \[x\].*Maintenance"; then
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "chore"
fi

if echo "$PR_BODY" | grep -qi "\- \[x\].*Breaking"; then
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "breaking"
else
gh pr edit "$PR_NUMBER" --repo "$REPO" --remove-label "breaking" 2>/dev/null || true
fi
label:
uses: QAtlasHub/.github/.github/workflows/labeler.yml@v1
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Pinax"
uuid = "e782a80a-1ac9-479e-ba2b-0f3433ef5b4f"
version = "0.39.15"
version = "0.39.16"
authors = ["sota shimozono <shimozono-sota631@g.ecc.u-tokyo.ac.jp>"]

[deps]
Expand Down Expand Up @@ -49,4 +49,4 @@ ParamIO = "938a3ac2-d340-473c-bcf1-88af577e4ccf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Aqua", "Downloads", "DataVault", "Documenter", "ParamIO"]
test = ["Test", "Aqua", "Downloads", "DataVault", "Documenter", "ParamIO"]
Loading