Skip to content

Commit 9c4acd6

Browse files
Update workflows for PR and issue automation
Refactored PR commenting logic to include conditional checks based on author and upgraded to `github-script@v7.0.1`. Improved issue workflow by adding auto-assign functionality and updating the thank-you comment format for better clarity.
1 parent 2933c18 commit 9c4acd6

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/issue.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,26 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- name: Post thank you comment tagging the issue author
13-
uses: actions/github-script@v6
12+
- name: Get PR Author
13+
id: pr_author
14+
run: echo "AUTHOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
15+
16+
- name: 'Auto-assign issue'
17+
uses: pozil/auto-assign-issue@39c06395cbac76e79afc4ad4e5c5c6db6ecfdd2e
18+
with:
19+
repo-token: ${{ secrets.GITHUB_TOKEN }}
20+
assignees: HichemTab-tech
21+
numOfAssignee: 1
22+
23+
- name: Comment on PR (if not the maintainer)
24+
if: env.AUTHOR != 'HichemTab-tech'
25+
uses: actions/github-script@v7.0.1
1426
with:
27+
github-token: ${{secrets.GITHUB_TOKEN}}
1528
script: |
16-
github.issues.createComment({
29+
github.rest.issues.createComment({
1730
issue_number: context.issue.number,
1831
owner: context.repo.owner,
1932
repo: context.repo.repo,
20-
body: `Thank you @${context.payload.issue.user.login} for opening this issue! We appreciate your feedback and will review your report as soon as possible.`
33+
body: `👋 Thank you @${context.payload.issue.user.login} for opening this issue! We appreciate your feedback and will review your report as soon as possible.`
2134
});

.github/workflows/pr-welcome.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
numOfAssignee: 1
2525

2626
- name: Comment on PR (if not the maintainer)
27-
#if: env.AUTHOR != 'HichemTab-tech'
27+
if: env.AUTHOR != 'HichemTab-tech'
2828
uses: actions/github-script@v7.0.1
2929
with:
3030
github-token: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)