Skip to content

Commit

Permalink
handle split-checkout scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercactapus committed Oct 7, 2024
1 parent ae78f14 commit d897c4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ 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: ${{ github.event.pull_request.merge_commit_sha }}
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
run: cd merge && ../base/devtools/scripts/github-set-pr-label.sh
3 changes: 2 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,8 @@ if [ -z "PR_NUMBER" ]; then
exit 1
fi

LABEL=$(./devtools/scripts/git-diff-label-calc.sh --debug)
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

0 comments on commit d897c4e

Please sign in to comment.