-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: issue template context for issue check and package #7190
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0e1562c
chore: existing issue required checkbox for a11y, bug and enhancement…
geospatialem 9d8e644
chore: calcite package checkbox to a11y, bug, enhancement templates
geospatialem f0c9d87
Merge remote-tracking branch 'origin/master' into geospatialem/chore-…
benelan 48d7364
ci: add action that labels issues with specified packages
benelan 2580710
Merge branch 'master' into geospatialem/chore-issue-template-checkbox
benelan 2fc7b5d
chore: review cleanup
benelan 3baf1d5
test(commonTests): restore disabled focus target testing for non-"non…
jcfranco 005836d
fix(input-date-picker): reset active date picker date after closing (…
jcfranco ec375a3
chore(linting): allow e2ePage variable naming (#7236)
jcfranco e18044d
chore: release next
github-actions[bot] ac7ab25
Merge branch 'master' into geospatialem/chore-issue-template-checkbox
benelan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,56 @@ | ||
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); | ||
|
||
if (packages?.length) { | ||
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], | ||
}); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could eliminate this check, and its associated nesting, by providing an empty array as a fallback when assigning
packages
above: