Skip to content

Commit b37522a

Browse files
authored
Merge pull request #884 from Anshika14528/greeting
Fixed issue in greeting.yml workflow #874
2 parents ce29da2 + efb77b2 commit b37522a

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

.github/workflows/greetings.yml

+39-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
name: Greetings
1+
name: 'Greetings'
22

3-
on: [pull_request_target, issues]
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request_target:
7+
types: [opened]
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
412

513
jobs:
6-
greeting:
14+
welcome:
715
runs-on: ubuntu-latest
8-
permissions:
9-
issues: write
10-
pull-requests: write
16+
1117
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v2
20+
1221
- name: Greet first-time contributors
1322
id: greet
1423
uses: actions/first-interaction@v1
@@ -18,3 +27,27 @@ jobs:
1827
Hi there! 👋 Thank you for opening your first issue on CodeHarborHub. We're excited to hear your thoughts and help you out. Please provide as much detail as you can so we can assist you effectively.
1928
pr-message: |
2029
Hi there! 👋 Thank you for submitting your first pull request to CodeHarborHub. We appreciate your contribution! Our team will review it soon. If you have any questions or need further assistance, feel free to reach out.
30+
31+
- name: Assign issue or pull request to team member
32+
if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
33+
run: |
34+
ISSUE_NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}
35+
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
36+
-d '{"assignees":["team-member"]}' \
37+
"https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}"
38+
39+
- name: Welcome message for community contributors
40+
if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
41+
uses: EddieHubCommunity/gh-action-community/src/welcome@main
42+
with:
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
issue-message: "Hi there! Thanks for opening this issue. We appreciate your contribution to this open-source project. We aim to respond or assign your issue as soon as possible."
45+
pr-message: "Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request to CodeHarborHub. We appreciate your contribution! Our team will review it soon. If you have any questions or need further assistance, feel free to reach out."
46+
47+
- name: Label first-time contributions
48+
if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
49+
run: |
50+
ISSUE_NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}
51+
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
52+
-d '{"labels":["first-time contribution"]}' \
53+
"https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}"

0 commit comments

Comments
 (0)