-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: issue template context for issue check and package (#7190)
**Related Issue:** n/a ## Summary Adds the following to the a11y, bug, and enhancement templates: 1. Adds a required checkbox verifying the submitter has checked for existing issues ![image](https://github.com/Esri/calcite-components/assets/5023024/0d0bdf20-8288-415a-9aa4-f0af4d08baad) 2. Adds checkbox options to specify the package of the request ![image](https://github.com/Esri/calcite-components/assets/5023024/ea508aaa-0db7-4fb2-b4f8-7cc0cd1a1416) cc @benelan for the ci/action on the checkbox options to add the `framework-react` label to the CCR checkbox when checked. --------- Co-authored-by: Ben Elan <no-reply@benelan.dev> Co-authored-by: JC Franco <jfranco@esri.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
be87dc5
commit e65e3c8
Showing
5 changed files
with
118 additions
and
12 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
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
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,54 @@ | ||
name: Add Package Label | ||
on: | ||
issues: | ||
types: [opened, edited] | ||
jobs: | ||
label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { | ||
repo: { owner, repo }, | ||
payload: { | ||
action, | ||
issue: { body, labels: currentLabels, number: issue_number }, | ||
}, | ||
} = context; | ||
if (!body) { | ||
console.log("could not determine the issue body"); | ||
return; | ||
} | ||
// NOTE: assumes all packages will be in the @esri NPM scope | ||
const packageRegex = /(?<=\[X\]\s@esri\/)[\w-]*$/gm; | ||
const packages = body.match(packageRegex) || []; | ||
for (const package of packages) { | ||
/** Creates a label if it does not exist */ | ||
try { | ||
await github.rest.issues.getLabel({ | ||
owner, | ||
repo, | ||
name: package, | ||
}); | ||
} catch (e) { | ||
await github.rest.issues.createLabel({ | ||
owner, | ||
repo, | ||
name: package, | ||
color: "BFBEAF", | ||
description: `Issues specific to the @esri/${package} package.`, | ||
}); | ||
} | ||
/** add new package label */ | ||
await github.rest.issues.addLabels({ | ||
issue_number, | ||
owner, | ||
repo, | ||
labels: [package], | ||
}); | ||
} |