-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add labels workflow #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| - 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
AI
Dec 30, 2025
There was a problem hiding this comment.
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.
| skip-delete: false | |
| skip-delete: true # Avoid deleting repository-specific labels not present in labels.yml |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.