Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
df23afa
chore: Add action to auto update labels on comments
EmandM Jan 8, 2025
1d2828b
Merge branch 'develop' into chore/add_auto_labeler
NoelStephensUnity Jan 15, 2025
53ec291
Merge branch 'develop' into chore/add_auto_labeler
NoelStephensUnity Feb 5, 2025
0f0b3ab
Merge branch 'develop' of https://github.com/Unity-Technologies/com.u…
EmandM Mar 7, 2025
bbadb74
Update syntax, add on-close action
EmandM Mar 8, 2025
0cd6449
Merge branch 'develop' into chore/add_auto_labeler
EmandM Mar 10, 2025
07b603d
temp
EmandM Mar 12, 2025
b2f53fd
Merge branch 'develop' into chore/add_auto_labeler
NoelStephensUnity Mar 13, 2025
6cbdbb0
Added stat:reply-needed label handling
michalChrobot Mar 18, 2025
d3db9b6
Merge branch 'develop' into chore/add_auto_labeler
michalChrobot Mar 18, 2025
8c10d1d
Added workflow for marking stale issues
michalChrobot Mar 18, 2025
d304910
Added workflow for managing assigning and unassignig from an issue
michalChrobot Mar 18, 2025
8bfb5fc
Added possibility of an manual trigger
michalChrobot Mar 18, 2025
672ed1e
Merge branch 'chore/add_auto_labeler' of https://github.com/Unity-Tec…
michalChrobot Mar 18, 2025
eeaaae1
Added stat:import label to the list of exclusion when deleting labels…
michalChrobot Mar 18, 2025
2921422
Merge branch 'develop' into chore/add_auto_labeler
michalChrobot Mar 18, 2025
58550ef
Comments added and rfc template removed
michalChrobot Mar 18, 2025
e7e9ee9
Merge branch 'develop' into chore/add_auto_labeler
michalChrobot Mar 20, 2025
1c1960a
Merge branch 'develop' into chore/add_auto_labeler
EmandM Mar 31, 2025
2474f90
Merge branch 'develop' into chore/add_auto_labeler
michalChrobot Apr 1, 2025
c78d5b2
Added preimplemented stale GitHub action
michalChrobot Apr 1, 2025
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
46 changes: 46 additions & 0 deletions .github/workflows/autolabel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update issue labels

on:
issue_comment:
types: [created]

concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
cancel-in-progress: true

# Define labels here
env:
AWAITING_RESPONSE: stat:awaiting response

jobs:
auto_label:
name: Calculate and update issue labels
if: ${{ !github.event.issue.pull_request }} && ${{ github.event.issue.state == 'open' }}
runs-on: ubuntu-latest
permissions:
issues: write

steps:
- name: Calculate labels
run: |
ADD_LABELS=()
REMOVE_LABELS=()

if [[ "${{ github.event.comment.author_association }}" == "MEMBER" ]]; then
ADD_LABELS+="${{ env.AWAITING_RESPONSE}}"
else
REMOVE_LABELS+="${{ env.AWAITING_RESPONSE}}"
fi


# Add further label logic here - uses bash

echo "ADD_LABELS=$(IFS=,; echo "${ADD_LABELS[*]}")" >> $GITHUB_ENV
echo "REMOVE_LABELS=$(IFS=,; echo "${REMOVE_LABELS[*]}")" >> $GITHUB_ENV

- name: Update labels
run: gh issue edit "$NUMBER" --add-label "$ADD_LABELS" --remove-label "$REMOVE_LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
32 changes: 32 additions & 0 deletions .github/workflows/removel-labels-on-issue-close.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Remove all labels when issue is closed

on:
issues:
types: [closed]

jobs:
auto_label:
name: Calculate and update issue labels
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
permissions:
issues: write

steps:
- name: Find labels
id: data
run: |
# Use jq to parse the JSON array and convert to bash array
LABELS=($(echo "$EXISTING_LABELS" | jq -r '.[]'))

# Format the labels for the gh command
echo "REMOVE_LABELS=$(IFS=,; echo "${LABELS[*]}")" >> $GITHUB_ENV
env:
EXISTING_LABELS: ${{ toJson(github.event.issue.labels.*.name) }}

- name: Remove labels
run: gh issue edit "$NUMBER" --remove-label "$REMOVE_LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}