Skip to content
Merged
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
49 changes: 14 additions & 35 deletions .github/workflows/pr_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,33 @@ jobs:
label:
permissions:
contents: read
issues: read
pull-requests: write
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
steps:
# label
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5
with:
sync-labels: true

missing-tests:
permissions:
contents: read
issues: read
pull-requests: write
runs-on: ubuntu-latest
steps:
# missing-tests
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
id: checkout
if: ${{ !cancelled() }}
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check for missing tests
id: check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
if: ${{ !cancelled() && steps.checkout.outcome == 'success' }}
run: |
gh api --paginate "repos/${REPO}/pulls/${PR_NUMBER}/files" \
| python utils/check_test_missing.py
- name: Add or remove missing-tests label
if: always()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
HAS_LABEL=$(gh api "repos/${REPO}/issues/${PR_NUMBER}/labels" --jq 'any(.[]; .name == "missing-tests")')
if [ "${{ steps.check.outcome }}" = "failure" ]; then
Expand All @@ -55,17 +50,9 @@ jobs:
fi
fi

fixes-issue:
permissions:
issues: read
pull-requests: write
runs-on: ubuntu-latest
steps:
# fixes-issue
- name: Check for linked closing issues
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
if: ${{ !cancelled() }}
run: |
OWNER="${REPO%/*}"
NAME="${REPO#*/}"
Expand Down Expand Up @@ -93,17 +80,9 @@ jobs:
fi
fi

size-label:
permissions:
issues: read
pull-requests: write
runs-on: ubuntu-latest
steps:
# size-label
- name: Label PR by diff size
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
if: ${{ !cancelled() }}
run: |
DIFF_SIZE=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}" --jq '.additions + .deletions')
if [ "$DIFF_SIZE" -lt 50 ]; then
Expand Down
Loading