Skip to content

Commit

Permalink
Add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertk committed Oct 17, 2024
1 parent a5c77e1 commit 51cdca6
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 1 deletion.
92 changes: 92 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Update repository labels

on:
workflow_dispatch:

jobs:
create-labels:
runs-on: ubuntu-latest
permissions:
issues: write
env:
LABELS: |
- name: bug
color: d73a4a
description: This is a bug report
- name: feature-request
color: 008672
description: This is regarding a missing feature
- name: documentation
color: f7bc35
description: This is a problem with published documentation
- name: announcement
description: ff9900
description: This is an announcement issue
- name: automation-exempt
color: c5def5
- name: blocked
color: 86499b
description: Work on this issue is blocked
- name: closed-for-staleness
color: ededed
description: This issue was closed due to inactivity
- name: closing-soon
color: 000000
description: This issue will close soon unless further comments are made
- name: duplicate
color: cfd3d7
description: This issue or pull request already exists
- name: investigating
color: 0000ff
description: This issue is under investigation
- name: needs-review
color: f996e2
description: This issue needs to be reviewed by a core team member
- name: needs-triage
color: c7cafc
description: This issue has not yet been looked at by the team
- name: p0
color: ff0000
description: This issue is of the highest priority
- name: p1
color: ff4500
description: This is a high priority issue
- name: p2
color: ff8c00
description: This is a standard priority issue
- name: p3
color: f5deb3
description: This is a low priority issue
- name: potential-regression
color: ff6700
description: This issue may be a regression
- name: queued
color: c6c8c6
description: This issue is in our backlog
- name: service-api
color: e06a18
description: This issue is related to the service API
- name: needs-reproduction
color: 0052cc
description: This issue needs reproduction steps or further work to reproduce
steps:
- uses: actions/github-script@v7
with:
script: |
const labels = JSON.parse(process.env.LABELS);
for (const label of labels) {
try {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label.name,
color: label.color,
description: label.description || '',
});
} catch (error) {
if (error.status === 422) {
core.info(`Label "${label.name}" already exists`);
} else {
core.warning(`Failed to create label "${label.name}": ${error.message}`);
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.*
!.gitignore
!.gitignore
!.github

0 comments on commit 51cdca6

Please sign in to comment.