Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
codycooperross committed Jul 26, 2024
1 parent be7602c commit 13d6120
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/scripts/manage_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ def delete_label_in_dest_repo(label_name):
print(EVENT_TYPE)

if EVENT_TYPE == "edited":
dest_label = get_label_in_repo(NAME, DEST_REPO)
from_name = FROM_NAME if FROM_NAME else NAME
dest_label = get_label_in_repo(from_name, DEST_REPO)
local_label = get_label_in_repo(NEW_NAME, GH_REPO)

changed = dest_label.get("name") != local_label.get("name") or dest_label.get("color") != local_label.get("color") or dest_label.get("description") != local_label.get("description")

if dest_label and changed:
update_label_in_dest_repo(NAME, local_label)
update_label_in_dest_repo(from_name, local_label)

if EVENT_TYPE == "deleted":
label_name = NAME
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_REPO: ${{ github.repository }}
NAME: ${{ github.event.changes.name.from && github.event.changes.name.from || github.event.label.name }}
FROM_NAME: ${{ github.event.changes.name.from }}
NAME: ${{ github.event.label.name }}
NEW_NAME: "${{ github.event.label.name }}"
NEW_COLOR: "${{ github.event.label.color }}"
NEW_DESCRIPTION: "${{ github.event.label.description }}"
Expand Down

0 comments on commit 13d6120

Please sign in to comment.