Skip to content

Commit

Permalink
JSON (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
palisadoes authored Jan 13, 2025
1 parent c29c113 commit 8417241
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/auto-label.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"labelsSynonyms": {
"dependencies": ["dependabot", "dependency", "dependencies"],
"security": ["security"],
},
"defaultLabels": ["unapproved"],
}
66 changes: 66 additions & 0 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
##############################################################################
##############################################################################
#
# NOTE!
#
# Please read the README.md file in this directory that defines what should
# be placed in this file
#
##############################################################################
##############################################################################

name: Issue Workflow
on:
issues:
types: ['opened']
jobs:
Opened-issue-label:
name: Adding Issue Label
runs-on: ubuntu-latest
steps:
- 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 }}
- uses: actions/github-script@v7
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
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Congratulations on making your first Issue! :confetti_ball: If you haven't already, check out our [Contributing Guidelines](https://github.com/PalisadoesFoundation/talawa-admin/blob/develop/CONTRIBUTING.md) and [Issue Reporting Guidelines](https://github.com/PalisadoesFoundation/talawa-admin/blob/develop/ISSUE_GUIDELINES.md) to ensure that you are following our guidelines for contributing and making issues."

0 comments on commit 8417241

Please sign in to comment.