Skip to content

Add GitHub Actions workflows for auto-labeling, PR checks, and issue triage#13

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-workflow-files
Open

Add GitHub Actions workflows for auto-labeling, PR checks, and issue triage#13
Copilot wants to merge 5 commits intomainfrom
copilot/add-workflow-files

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

  • Create .github/workflows/ directory
  • Create auto-label.yml workflow file - Automatically labels PRs based on files changed
  • Create pr-checks.yml workflow file - Runs build checks on PRs and pushes to main
  • Create issue-triage.yml workflow file - Adds 'needs-triage' label to new issues
  • Create .github/labeler.yml configuration file for auto-labeling
  • Address review comments:
    • Added sync-labels: true to auto-label.yml for proper label syncing
    • Removed redundant 'opened' action check from issue-triage.yml
    • Updated labeler.yml to use **/*.yml and **/*.yaml patterns for subdirectory matching

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot AI changed the title [WIP] Add workflow files for automation Add GitHub Actions workflows for auto-labeling, PR checks, and issue triage Jan 29, 2026
Copilot AI requested a review from groupthinking January 29, 2026 18:38
@groupthinking groupthinking marked this pull request as ready for review February 5, 2026 11:53
Copilot AI review requested due to automatic review settings February 5, 2026 11:53
Copy link
Contributor

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 introduces GitHub Actions automation for repository management, including automatic PR labeling based on file changes, CI/CD build checks, and automatic triage labeling for new issues.

Changes:

  • Added auto-labeling workflow that applies labels to PRs based on which files are modified
  • Added PR checks workflow that runs Node.js build validation on pull requests and main branch pushes
  • Added issue triage workflow that automatically labels new issues with 'needs-triage'
  • Created labeler configuration defining rules for documentation, source, config, and workflow labels

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/auto-label.yml Implements automatic PR labeling using actions/labeler@v5
.github/workflows/pr-checks.yml Runs Node.js 20 build checks with npm ci and TypeScript compilation
.github/workflows/issue-triage.yml Automatically adds triage label to newly opened issues
.github/labeler.yml Defines file path patterns for automatic label assignment

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

@groupthinking
Copy link
Owner

@copilot apply changes based on the comments in this thread

…ate glob patterns

Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 6, 2026

@copilot apply changes based on the comments in this thread

Applied all three changes from the review in commit 3af704b:

  • Added sync-labels: true to auto-label.yml
  • Removed redundant action check from issue-triage.yml
  • Updated glob patterns to **/*.yml and **/*.yaml for subdirectory matching

groupthinking
groupthinking previously approved these changes Feb 6, 2026
@groupthinking groupthinking requested a review from Copilot February 6, 2026 16:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment on lines +3 to +6
on:
pull_request:
types: [opened, edited, synchronize]

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

Using the pull_request event means this workflow will not be able to apply labels on PRs coming from forks (the GITHUB_TOKEN is read-only for forked PRs). If this repo expects external contributions, consider switching to pull_request_target (and avoid checking out untrusted code) so labeling still works for fork PRs.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +21
- name: Label PR based on files changed
uses: actions/labeler@v5
with:
sync-labels: true
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

Both this workflow and .github/labeler.yml assume the target labels already exist in the repo. If any label is missing, actions/labeler can fail when attempting to apply it. Consider adding a separate label-provisioning workflow (or documented setup step) to ensure required labels exist before enabling auto-labeling.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +23
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['needs-triage']
});
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

This will fail if the needs-triage label doesn't already exist in the repository (GitHub API returns 422 for unknown labels). Consider creating the label if missing (or documenting label setup) so new repos/environments don't have a broken triage workflow.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment on lines +20 to +23
with:
sync-labels: true
with:
sync-labels: true
Copy link

Choose a reason for hiding this comment

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

Bug: The auto-label.yml workflow has a duplicate with: key. This will cause the GitHub Actions workflow to fail at runtime when it's triggered.
Severity: CRITICAL

Suggested Fix

Remove the duplicate with: key from the Label PR based on files changed step in the .github/workflows/auto-label.yml file to ensure the YAML is parsed correctly by the GitHub Actions runner.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/auto-label.yml#L20-L23

Potential issue: The GitHub Actions workflow file `auto-label.yml` contains a duplicate
`with:` key within the `Label PR based on files changed` step. While this might be valid
in some YAML parsers, the GitHub Actions runner uses a strict parser that will reject
this configuration at runtime. This will cause the `auto-label` workflow to fail every
time it is triggered, such as when a pull request is opened, preventing pull requests
from being automatically labeled. The failure occurs during workflow execution, not
during the merge, so it will not be caught by standard pre-merge checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants