Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: this is a test PR, disregard #4102

Closed
wants to merge 9 commits into from
Closed
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
16 changes: 11 additions & 5 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: labeler

on:
pull_request:
pull_request_target:
types: ['opened', 'ready_for_review', 'reopened', 'synchronize']

jobs:
Expand All @@ -14,11 +13,18 @@ jobs:
name: Label the PR size
steps:
- uses: actions/checkout@v4
with:
with: # checkout the base branch, where we run the script from
path: base
- uses: actions/checkout@v4
with: # checkout the merge commit, where the PR changes are
ref: refs/pull/${{ github.event.number }}/merge
path: merge
# we need full history
fetch-depth: 0
- name: Run labeler script
- name: Run labeler script from base
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
FAIL_IF_XL: '1'
run: ./devtools/scripts/github-set-pr-label.sh
MAIN_BRANCH: ${{ github.event.pull_request.base.ref }}
run: cd merge && ../base/devtools/scripts/github-set-pr-label.sh
7 changes: 6 additions & 1 deletion devtools/scripts/github-set-pr-label.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ if [ -z "PR_NUMBER" ]; then
exit 1
fi

LABEL=$(./devtools/scripts/git-diff-label-calc.sh --debug)
# test change
# 4 lines
# total

MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LABEL=$("$MY_DIR/git-diff-label-calc.sh" --debug)

# Remove any existing test/* labels
for label in $(gh pr view "$PR_NUMBER" --json labels --jq '.labels[] | select(.name | startswith("size/")) | .name'); do
Expand Down
Loading