-
Notifications
You must be signed in to change notification settings - Fork 116
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
adcb84a
commit 26c87b6
Showing
1 changed file
with
39 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'Auto Label Assignment' | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
assign-labels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Assign always-required labels | ||
run: | | ||
# Always add these labels | ||
echo "Adding always assigned labels: hacktoberfest, hacktoberfest-accepted, hactoberfest2024" | ||
gh issue edit ${{ github.event.issue.number || github.event.pull_request.number }} --add-label "hacktoberfest" | ||
gh issue edit ${{ github.event.issue.number || github.event.pull_request.number }} --add-label "hacktoberfest-accepted" | ||
gh issue edit ${{ github.event.issue.number || github.event.pull_request.number }} --add-label "hactoberfest2024" | ||
- name: Auto assign specific labels based on conditions | ||
run: | | ||
ISSUE_TITLE="${{ github.event.issue.title || github.event.pull_request.title }}" | ||
# Conditional label assignment based on title | ||
if [[ "${ISSUE_TITLE,,}" =~ "bug" ]]; then | ||
echo "Adding label 'bug'" | ||
gh issue edit ${{ github.event.issue.number || github.event.pull_request.number }} --add-label "bug" | ||
elif [[ "${ISSUE_TITLE,,}" =~ "documentation" ]]; then | ||
echo "Adding label 'documentation'" | ||
gh issue edit ${{ github.event.issue.number || github.event.pull_request.number }} --add-label "documentation" | ||
elif [[ "${ISSUE_TITLE,,}" =~ "enhancement" ]]; then | ||
echo "Adding label 'enhancement'" | ||
gh issue edit ${{ github.event.issue.number || github.event.pull_request.number }} --add-label "enhancement" | ||
else | ||
echo "No additional matching label found for this issue or PR." |