Skip to content

Improve error handling in create-labels workflow#34

Merged
Chris-Wolfgang merged 2 commits intogithub-folder-changesfrom
copilot/sub-pr-27
Dec 18, 2025
Merged

Improve error handling in create-labels workflow#34
Chris-Wolfgang merged 2 commits intogithub-folder-changesfrom
copilot/sub-pr-27

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 18, 2025

Description

The create-labels.yaml workflow was silently ignoring all errors in the "dependencies" and "dotnet" label creation steps, which could mask authentication failures, rate limiting, or API issues.

Updated error handling to:

  • Check specifically for already_exists errors (status 422)
  • Log descriptive messages when labels already exist
  • Re-throw all other errors with context for debugging
catch (error) {
  if (error.status === 422 && error.response?.data?.errors?.[0]?.code === 'already_exists') {
    console.log('Label "dependencies" already exists, skipping creation');
  } else {
    console.error('Failed to create label "dependencies":', error.message);
    throw error;
  }
}

This aligns error handling across all four label creation steps in the workflow.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor

How Has This Been Tested?

  • YAML syntax validation with yamllint
  • Automated code review
  • CodeQL security scanning

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

N/A

Additional context

Addresses review feedback from PR #27 about improving error visibility in GitHub Actions workflows.


💡 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.

Copilot AI self-assigned this Dec 18, 2025
Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
Copilot AI changed the title [WIP] Update .github folder based on review feedback Improve error handling in create-labels workflow Dec 18, 2025
Copilot AI requested a review from Chris-Wolfgang December 18, 2025 21:48
@Chris-Wolfgang Chris-Wolfgang marked this pull request as ready for review December 18, 2025 21:54
@Chris-Wolfgang Chris-Wolfgang merged commit eb1d693 into github-folder-changes Dec 18, 2025
@Chris-Wolfgang Chris-Wolfgang deleted the copilot/sub-pr-27 branch December 19, 2025 03:34
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