-
-
Notifications
You must be signed in to change notification settings - Fork 2
[Bug]: Labeler failed with "Resource not accessible by integration" #137
Description
Description
Run actions/github-script@ed59741
with:
script: const labels = JSON.parse(process.env.LABELS_JSON);
for (const label of labels) {
try {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label.name,
description: label.description || '',
color: label.color
});
} catch (error) {
// Check if the error is because the label already exists
if (error.status === 422) {
console.log(Label '${label.name}' already exists. Skipping.);
} else {
// Log other errors
console.error(Error creating label '${label.name}': ${error});
}
}
}
github-token: ***
debug: false
user-agent: actions/github-script
result-encoding: json
retries: 0
retry-exempt-status-codes: 400,401,403,404,422
env:
LABELS_JSON: [
{"name": "breaking", "color": "ff0000", "description": "Breaking change"},
{"name": "chore", "color": "ededed", "description": "Maintenance, tooling, or housekeeping"},
{"name": "dependencies", "color": "bfd4f2", "description": "Dependency updates"},
{"name": "docs", "color": "0075ca", "description": "Documentation changes"},
{"name": "feat", "color": "0e8a16", "description": "New feature or enhancement"},
{"name": "fix", "color": "d73a4a", "description": "Bug fix"},
{"name": "ignore", "color": "ededed", "description": "Exclude this PR from the release changelog"},
{"name": "refactor", "color": "5319e7", "description": "Code refactoring without behavior change"},
{"name": "agents", "color": "e4e669", "description": "AI agent guidelines changed"},
{"name": "build", "color": "5319e7", "description": "Build script or versioning changed"},
{"name": "ci", "color": "bfdadc", "description": "CI/CD workflows or actions changed"},
{"name": "cmdlets", "color": "c5def5", "description": "Source functions changed"},
{"name": "devcontainer", "color": "006b75", "description": "Dev container changed"},
{"name": "github", "color": "6e5494", "description": "GitHub config files changed"},
{"name": "lint", "color": "f9d0c4", "description": "PSScriptAnalyzer config changed"},
{"name": "security", "color": "e36209", "description": "InjectionHunter config changed"},
{"name": "template", "color": "f9d0c4", "description": "Bootstrap template files changed"},
{"name": "tests", "color": "d876e3", "description": "Test files changed"},
{"name": "vscode", "color": "1d76db", "description": "VS Code settings changed"}
]
Error creating label 'breaking': HttpError: Resource not accessible by integration
Error creating label 'chore': HttpError: Resource not accessible by integration
Error creating label 'dependencies': HttpError: Resource not accessible by integration
Error creating label 'docs': HttpError: Resource not accessible by integration
Error creating label 'feat': HttpError: Resource not accessible by integration
Error creating label 'fix': HttpError: Resource not accessible by integration
Error creating label 'ignore': HttpError: Resource not accessible by integration
Error creating label 'refactor': HttpError: Resource not accessible by integration
Error creating label 'agents': HttpError: Resource not accessible by integration
Error creating label 'build': HttpError: Resource not accessible by integration
Error creating label 'ci': HttpError: Resource not accessible by integration
Error creating label 'cmdlets': HttpError: Resource not accessible by integration
Error creating label 'devcontainer': HttpError: Resource not accessible by integration
Error creating label 'github': HttpError: Resource not accessible by integration
Error creating label 'lint': HttpError: Resource not accessible by integration
Error creating label 'security': HttpError: Resource not accessible by integration
Error creating label 'template': HttpError: Resource not accessible by integration
Error creating label 'tests': HttpError: Resource not accessible by integration
Error creating label 'vscode': HttpError: Resource not accessible by integration
Steps to Reproduce
- Create repository from template
- Observe labeler failing silently
Expected Behavior
It should create all the required labels
Actual Behavior
Silently fails
Environment Information
New repoCode Sample
Error Messages / Logs
Additional Context
No response