forked from tailcallhq/tailcall
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83646e4
commit 830fade
Showing
1 changed file
with
7 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,18 @@ jobs: | |
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Remove existing labels | ||
uses: actions/labeler@v5 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
action: remove | ||
|
||
- name: Run Labeler | ||
uses: actions/labeler@v5 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
sync-labels: true | ||
|
||
# label based on PR title | ||
- uses: github/[email protected] | ||
with: | ||
|
@@ -25,25 +31,3 @@ jobs: | |
enable-versioned-regex: 0 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
sync-labels: true | ||
|
||
remove-unused-labels: | ||
runs-on: ubuntu-latest | ||
needs: labeler | ||
steps: | ||
- name: Get current labels | ||
run: | | ||
current_labels=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/labels" | \ | ||
jq -r '.[].name') | ||
echo "Current labels: $current_labels" | ||
- name: Remove unused labels | ||
run: | | ||
unused_labels="chore docs fix feature" | ||
for label in $unused_labels; do | ||
if [[ ! "$current_labels" =~ "$label" ]]; then | ||
echo "Removing label: $label" | ||
curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/$label" | ||
fi | ||
done |