-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new GitHub workflows for better automation and issue tracking(#27)
- Loading branch information
Showing
5 changed files
with
236 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 'Close stale issues' | ||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
cleanup: | ||
runs-on: ubuntu-latest | ||
name: Stale issue cleanup | ||
steps: | ||
- uses: aws-actions/stale-issue-cleanup@v6 | ||
with: | ||
issue-types: 'issues,pull_requests' | ||
ancient-issue-message: > | ||
This issue has been automatically closed due to inactivity. If you | ||
believe this was closed in error, please create a new issue and | ||
link to this auto-closed issue. Thank you. | ||
stale-issue-message: > | ||
This issue has not received a response in one week. If you wish to | ||
keep this open, please leave a comment and auto-close will be | ||
cancelled. | ||
stale-pr-message: > | ||
This pull request has not received a response in one week. If you | ||
wish to keep this open, please leave a comment and auto-close will | ||
be cancelled. | ||
stale-issue-label: closing-soon | ||
exempt-issue-labels: automation-exempt | ||
stale-pr-label: no-pr-activity | ||
response-requested-label: response-requested | ||
closed-for-staleness-label: closed-for-staleness | ||
days-before-stale: 10 | ||
days-before-close: 4 | ||
days-before-ancient: 36500 | ||
minimum-upvotes-to-exempt: 2 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
use-created-date-for-ancient: false | ||
dry-run: false | ||
#loglevel: debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Closed Issue Message | ||
on: | ||
issues: | ||
types: [closed] | ||
|
||
jobs: | ||
auto_comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: aws-actions/closed-issue-message@v1 | ||
with: | ||
# These inputs are both required | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
message: | | ||
This issue is now closed. Comments on closed issues are hard for our team to see. | ||
If you need more assistance, please open a new issue that references this one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
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": 8672, | ||
"description": "This is regarding a missing feature" | ||
}, | ||
{ | ||
"name": "documentation", | ||
"color": "f7bc35", | ||
"description": "This is a problem with published documentation" | ||
}, | ||
{ | ||
"name": "announcement", | ||
"color": "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": 0, | ||
"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" | ||
}, | ||
{ | ||
"name": "no-pr-activity", | ||
"color": "f7c6c7", | ||
"description": "This pull request has not received recent activity" | ||
} | ||
] | ||
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, | ||
description: label.description || '', | ||
color: label.color | ||
}); | ||
} catch (error) { | ||
if (error.status === 422) { | ||
core.info(`Label "${label.name}" already exists`); | ||
} else { | ||
core.warning(`Failed to create label "${label.name}": ${error.message}`); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Apply potential regression label on issues | ||
name: issue-regression-label | ||
on: | ||
issues: | ||
types: [opened, edited] | ||
|
||
jobs: | ||
add-regression-label: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- name: Fetch template body | ||
id: check_regression | ||
uses: actions/github-script@v7 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TEMPLATE_BODY: ${{ github.event.issue.body }} | ||
with: | ||
script: | | ||
const regressionPattern = /\[x\] Select this option if this issue appears to be a regression\./i; | ||
const template = `${process.env.TEMPLATE_BODY}` | ||
const match = regressionPattern.test(template); | ||
core.setOutput('is_regression', match); | ||
- name: Manage regression label | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if [ "${{ steps.check_regression.outputs.is_regression }}" == "true" ]; then | ||
gh issue edit ${{ github.event.issue.number }} --add-label "potential-regression" -R ${{ github.repository }} | ||
else | ||
gh issue edit ${{ github.event.issue.number }} --remove-label "potential-regression" -R ${{ github.repository }} | ||
fi |