Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

chore: add labels workflow#1

Merged
lusu007 merged 1 commit intomainfrom
chore/label-sync
Dec 30, 2025
Merged

chore: add labels workflow#1
lusu007 merged 1 commit intomainfrom
chore/label-sync

Conversation

@lusu007
Copy link
Copy Markdown
Contributor

@lusu007 lusu007 commented Dec 30, 2025

Pull Request

Description

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • ♻️ Refactoring
  • 📚 Documentation
  • 🔧 Chore

Related Issues

  • Fixes #

Testing

  • Unit tests pass
  • Manual testing completed
  • New tests added for new functionality

Checklist

  • I have performed a self-review of my own code
  • Tests have been added/updated and pass (if needed)
  • Documentation has been updated (if needed)

Copilot AI review requested due to automatic review settings December 30, 2025 22:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a GitHub Actions workflow to automatically sync repository labels from a centralized labels.yml file hosted in the groundsgg/.github repository. The workflow helps maintain consistent labeling across repositories in the organization.

  • Adds automated label synchronization triggered by changes to the workflow file, pull requests, or manual dispatch
  • Downloads label configuration from a central repository to maintain consistency
  • Uses dry-run mode for pull requests to preview changes without applying them

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.
- 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 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.
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.
Comment on lines +34 to +37
exclude: |
help*
*issue
autorelease* No newline at end of file
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.
@lusu007 lusu007 merged commit 0e525f5 into main Dec 30, 2025
9 checks passed
@lusu007 lusu007 deleted the chore/label-sync branch January 2, 2026 21:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants