-
Notifications
You must be signed in to change notification settings - Fork 36
CHORE: Add auto acknowledgment workflow for new issues #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+54
−0
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
79c2666
Add auto acknowledgment workflow for new issues
sumitmsft 5a4d620
Merge branch 'main' into sumitmsft/auto-ack-ghissues
jahnvi480 73e5bbf
Potential fix for code scanning alert no. 747: Workflow does not cont…
sumitmsft 9cb2946
Update .github/workflows/issue-acknowledge.yml
sumitmsft 6f88274
Merge branch 'main' into sumitmsft/auto-ack-ghissues
gargsaumya 1588486
Merge branch 'main' into sumitmsft/auto-ack-ghissues
sumitmsft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Auto Acknowledge GH Issues | ||
|
|
||
| on: | ||
| issues: | ||
| types: [opened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| jobs: | ||
| acknowledge: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: read | ||
| steps: | ||
| # Step 1: Wait 15 minutes | ||
| - name: Wait 15 minutes | ||
| run: sleep 10 | ||
sumitmsft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Step 2: Check if a maintainer already responded | ||
| - name: Check for existing maintainer response | ||
| id: check | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const maintainers = ['sumitmsft','dlevy-msft-sql']; | ||
|
|
||
| const comments = await github.rest.issues.listComments({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.payload.issue.number | ||
| }); | ||
|
|
||
| const maintainerReplied = comments.data.some( | ||
| comment => maintainers.includes(comment.user.login) | ||
| ); | ||
|
|
||
| core.setOutput('skip', maintainerReplied.toString()); | ||
| console.log(`Maintainer already replied: ${maintainerReplied}`); | ||
|
|
||
| # Step 3: Post acknowledgement ONLY if no maintainer has responded | ||
| - name: Post acknowledgement comment | ||
| if: steps.check.outputs.skip == 'false' | ||
| uses: actions/github-script@v7 | ||
sumitmsft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| github-token: ${{ secrets.SUMIT_PAT_FOR_AUTO_RESPONSE }} | ||
| script: | | ||
sumitmsft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.payload.issue.number, | ||
| body: `Hi @${context.payload.issue.user.login}, thank you for opening this issue!\n\nOur team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.\n\nThank you for your patience!` | ||
| }); | ||
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.