Skip to content

Commit b16ff97

Browse files
GarboMuffinjexjws
authored andcommitted
Update autolabeler workflow again (TurboWarp#1868)
1 parent 237bfcd commit b16ff97

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/label.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
label-pull-request:
1313
runs-on: ubuntu-latest
1414

15+
# This workflow is not useful to forks without significantly updating the workflow script.
16+
if: ${{ github.repository == 'TurboWarp/extensions' }}
17+
1518
permissions:
1619
pull-requests: write
1720

@@ -32,20 +35,20 @@ jobs:
3235
3336
if [[ "$BASE_REF" == "master" ]]; then
3437
# Download just the diff so it is harder to accidentally run any code from the pull request.
35-
gh pr diff --repo TurboWarp/desktop "$PR_NUMBER" > pr.diff
38+
gh pr diff --repo TurboWarp/extensions "$PR_NUMBER" > pr.diff
3639
3740
# Note that pcregrep exits with success on any match, failure on no match
3841
if pcregrep -M "^--- /dev/null\n\+\+\+ b/extensions/" pr.diff; then
3942
# Example:
4043
# --- /dev/null
4144
# +++ b/extensions/DangoCat/extension.js
42-
gh pr edit --repo TurboWarp/desktop "$PR_NUMBER" --add-label "$LABEL_NEW_EXTENSION"
45+
gh pr edit --repo TurboWarp/extensions "$PR_NUMBER" --add-label "$LABEL_NEW_EXTENSION"
4346
got_any_specific_label=true
4447
elif pcregrep "^\+\+\+ b/extensions/" pr.diff; then
4548
# Example:
4649
# --- a/extensions/DangoCat/extension.js
4750
# +++ b/extensions/DangoCat/extension.js
48-
gh pr edit --repo TurboWarp/desktop "$PR_NUMBER" --add-label "$LABEL_CHANGE_EXTENSION"
51+
gh pr edit --repo TurboWarp/extensions "$PR_NUMBER" --add-label "$LABEL_CHANGE_EXTENSION"
4952
got_any_specific_label=true
5053
fi
5154
else
@@ -54,7 +57,7 @@ jobs:
5457
5558
# Any PR that didn't get a specific label will go into other, for a human to look at.
5659
if [[ "$got_any_specific_label" == "false" ]]; then
57-
gh pr edit --repo TurboWarp/desktop "$PR_NUMBER" --add-label "$LABEL_OTHER"
60+
gh pr edit --repo TurboWarp/extensions "$PR_NUMBER" --add-label "$LABEL_OTHER"
5861
fi
5962
env:
6063
PR_NUMBER: "${{ github.event.number }}"

0 commit comments

Comments
 (0)