Skip to content

Commit

Permalink
chore(workflow): enhance label sync with GitHub CLI setup
Browse files Browse the repository at this point in the history
This commit enhances the GitHub Actions workflow for syncing labels
by setting up and installing the GitHub CLI. This allows for more
robust label management, leveraging GitHub CLI commands for label
creation and updates. The use of `GH_TOKEN` ensures secure
authentication, improving the overall workflow security and efficiency.
  • Loading branch information
YidiDev committed Oct 5, 2024
1 parent bb858b6 commit 6b9cf79
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up GitHub CLI
uses: actions/setup-node@v4
with:
node-version: '16'

- name: Install GitHub CLI
run: sudo apt-get install -y gh

- name: Configure repository labels
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "::group::Reading labels JSON file"
labels=$(cat .github/labels.json)
Expand All @@ -30,7 +40,5 @@ jobs:
echo "Updating label: $name with color #$color and description '$description'"
# Update the labels using the create-or-update-label action
gh label create "$name" --color "$color" --description "$description" || gh label edit "$name" --color "$color" --description "$description"
done

0 comments on commit 6b9cf79

Please sign in to comment.