Skip to content

[New]: Hackerrank solution #3

[New]: Hackerrank solution

[New]: Hackerrank solution #3

name: DSA Issue Management
on:
issues:
types: [opened, edited, closed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Label issues
uses: actions/labeler@v4
with:
configuration_path: .github/labels.yml
- name: Assign issues
uses: actions/github-script@v5
with:
script: |
github.issues.update({
issue_number: context.issue.number,
assignees: ['assignee1', 'assignee2']
})
- name: Notify assignees
uses: actions/github-script@v5
with:
script: |
github.issues.createComment({
issue_number: context.issue.number,
body: '@assignee1, @assignee2, you have been assigned this issue.'
})
- name: Close duplicate issues
uses: actions/github-script@v5
with:
script: |
const duplicates = await github.issues.listForRepo({
repository: context.repo.name,
issue_number: context.issue.number,
duplicates: true
})
duplicates.forEach(async (duplicate) => {
await github.issues.update({
issue_number: duplicate.issue_number,
state: 'closed'
})
})