Skip to content

Commit

Permalink
feat: added the auto assign workflow yaml file
Browse files Browse the repository at this point in the history
feat: added the auto assign workflow yaml file
  • Loading branch information
rajdip-b authored Jan 5, 2024
2 parents 091e49b + 6459622 commit eadca0c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/auto-assign.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Auto-assign issue on /attempt comment

on:
issue_comment:
types: [created]

jobs:
auto-assign:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const comment = context.payload.comment;
const issue = context.issue;
if (comment.body.startsWith('/attempt')) {
if (!issue.assignee) {
github.issues.assignees.add({
issue_number: issue.number,
assignees: [comment.user.login]
});
await github.issues.createComment({
issue_number: issue.number,
body: 'Assigned the issue to you!'
});
} else {
await github.issues.createComment({
issue_number: issue.number,
body: 'This issue is already assigned. Tag a maintainer if you need to take over.'
});
}
}
9 changes: 9 additions & 0 deletions CONTRIBUTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ Before reporting a bug, please check our list of [open issues](https://github.co

If you have ideas for improvements or new features we would love to hear them. Please provide as much detail as possible so we can fully understand your ideas. You can [create a new issue](https://github.com/keyshade-xyz/keyshade/issues/new/choose) to share your suggestions.

## Self Assigning Issues

1. To express interest in working on an issue, simply type `/attempt` at the beginning of a comment.
2. If the issue is unassigned, it will be automatically assigned to you. ✨
3. If the issue is already assigned, you'll receive a message indicating the need to contact a maintainer to discuss reassignment.

**Example:**
`/attempt` I'd like to work on this issue.

## Code Contribution

Please ensure your pull request adheres to the following guidelines:
Expand Down

0 comments on commit eadca0c

Please sign in to comment.