Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.
Merged
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 🏷️ Sync Labels

on:
push:
branches:
- 'main'
paths:
- '.github/workflows/labels.yml'
pull_request:
paths:
- '.github/workflows/labels.yml'
workflow_dispatch: # Allow manual triggering

permissions:
contents: read
issues: write

jobs:
sync-labels:
name: 🏷️ Sync repository labels
runs-on: ubuntu-latest
steps:
- name: πŸ“¦ Download labels.yml
run: |
curl -fsSL "https://raw.githubusercontent.com/groundsgg/.github/refs/heads/main/.github/labels.yml" -o labels.yml
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL uses 'refs/heads/main' which is verbose. GitHub's raw content URLs work more reliably with just the branch name 'main'. Consider using 'https://raw.githubusercontent.com/groundsgg/.github/main/.github/labels.yml' instead for better compatibility and clarity.

Suggested change
curl -fsSL "https://raw.githubusercontent.com/groundsgg/.github/refs/heads/main/.github/labels.yml" -o labels.yml
curl -fsSL "https://raw.githubusercontent.com/groundsgg/.github/main/.github/labels.yml" -o labels.yml

Copilot uses AI. Check for mistakes.

Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow downloads labels.yml from an external repository but doesn't verify the download succeeded or validate the file content before using it. If the download fails silently or returns invalid content, the labeler action may behave unexpectedly. Consider adding a validation step to check that the file exists and contains valid YAML before proceeding to the sync step.

Suggested change
- name: βœ… Validate labels.yml
run: |
if [ ! -s labels.yml ]; then
echo "Error: labels.yml was not downloaded or is empty."
exit 1
fi
# Validate that labels.yml contains syntactically valid YAML
ruby -ryaml -e "YAML.load_file('labels.yml')" || {
echo "Error: labels.yml is not valid YAML."
exit 1
}

Copilot uses AI. Check for mistakes.
- name: 🏷️ Sync labels
uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: labels.yml
dry-run: ${{ github.event_name == 'pull_request' }}
skip-delete: false
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting 'skip-delete: false' means labels not in the source file will be permanently deleted from the repository. This could be destructive if the downloaded labels.yml is incomplete or if there are repository-specific labels. Consider setting this to 'true' or adding a comment explaining why deletion is safe in this context.

Suggested change
skip-delete: false
skip-delete: true # Avoid deleting repository-specific labels not present in labels.yml

Copilot uses AI. Check for mistakes.
exclude: |
help*
*issue
autorelease*
Comment on lines +34 to +37
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exclude patterns may not work as intended. The pattern 'issue' will exclude labels ending with 'issue', but 'help' and 'autorelease*' use prefix wildcards. Without documentation explaining what labels these patterns are meant to protect, it's unclear if this configuration is correct. Consider adding a comment explaining which specific labels should be excluded and why.

Copilot uses AI. Check for mistakes.