-
-
Notifications
You must be signed in to change notification settings - Fork 876
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Workflow changes which will label issues automatically as per #…
…2256 (#2390) * added actions actions/checkout@v4 & actions/github-script@v6 * Auto-label synonyms and default labels added * removal of unneccessary log * changes by coderabbitai --------- Co-authored-by: Peter Harrison <[email protected]>
- Loading branch information
1 parent
2fffd90
commit 317dd68
Showing
2 changed files
with
43 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"labelsSynonyms": { | ||
"dependencies": ["dependabot", "dependency", "dependencies"], | ||
"security": ["security"], | ||
"ui/ux": ["layout", "screen", "design", "figma"] | ||
}, | ||
"defaultLabels": ["unapproved"], | ||
} |
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 |
---|---|---|
|
@@ -18,12 +18,43 @@ jobs: | |
name: Adding Issue Label | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: Renato66/[email protected] | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.github/workflows/auto-label.json5 | ||
sparse-checkout-cone-mode: false | ||
- uses: Renato66/auto-label@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
ignore-comments: true | ||
default-labels: '["unapproved"]' | ||
|
||
- uses: actions/github-script@v6 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
script: | | ||
const { owner, repo } = context.repo; | ||
const issue_number = context.issue.number; | ||
const apiParams = { | ||
owner, | ||
repo, | ||
issue_number | ||
}; | ||
const labels = await github.rest.issues.listLabelsOnIssue(apiParams); | ||
if(labels.data.reduce((a, c)=>a||["dependencies"].includes(c.name), false)) | ||
await github.rest.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
labels: ["good first issue", "security"] | ||
}); | ||
else if(labels.data.reduce((a, c)=>a||["security", "ui/ux"].includes(c.name), false)) | ||
await github.rest.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
labels: ["good first issue"] | ||
}); | ||
Issue-Greeting: | ||
name: Greeting Message to User | ||
runs-on: ubuntu-latest | ||
|