forked from jfmartinz/ResourceHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jfmartinz:main' into main
- Loading branch information
Showing
95 changed files
with
7,355 additions
and
8,971 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 |
---|---|---|
@@ -1,20 +1,39 @@ | ||
name: Add Label | ||
name: Auto-label on Any Issue | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
pull_request: | ||
types: [opened] | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
add_label: | ||
auto-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v6 | ||
- name: Add labels to any new issue or PR | ||
uses: actions/github-script@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.issues.listForRepo({ owner: context.repo.owner, repo: context.repo.repo }) | ||
.then(response => response.data.map(issue => ({ issue_number: issue.number }))) | ||
.then(issues => Promise.all(issues.map(issue => github.issues.addLabels(context.repo.owner, context.repo.repo, issue.issue_number, ["gssoc"])))) | ||
.catch(error => console.error(error)); | ||
const labelsToAdd = ["gssoc"]; | ||
if (context.issue.pull_request) { | ||
// It's a Pull Request | ||
await github.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.issue.number, | ||
labels: labelsToAdd | ||
}); | ||
} else { | ||
// It's an Issue | ||
await github.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
labels: labelsToAdd | ||
}); | ||
} |
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
Oops, something went wrong.