Skip to content

Commit

Permalink
added actions actions/checkout@v4 & actions/github-script@v6
Browse files Browse the repository at this point in the history
  • Loading branch information
SGI-CAPP-AT2 authored Oct 31, 2024
1 parent af2f509 commit 2d87d33
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,44 @@ jobs:
name: Adding Issue Label
runs-on: ubuntu-latest
steps:
- uses: Renato66/auto-label@v2.3.0
- 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 labels = await github.rest.issues.listLabelsOnIssue({
owner,
repo,
issue_number
});
console.log(labels.data, labels.data.reduce((a, c)=>console.log(c.name, c.name in ["security", "ui/ux", "dependencies"]), false))
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
Expand Down

0 comments on commit 2d87d33

Please sign in to comment.