From 73d11a4c977a990522836a0a153c0f5cf71dc786 Mon Sep 17 00:00:00 2001 From: Anshika Yadav <14anshika7yadav@gmail.com> Date: Sun, 9 Jun 2024 22:09:31 +0530 Subject: [PATCH 1/2] Issue in greeting.yml workflow #874 --- .github/workflows/greetings.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index b115050af..fa59f0fa7 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,20 +1,23 @@ -name: Greetings +name: 'Greetings' -on: [pull_request_target, issues] +on: + issues: + types: [opened] + pull_request_target: + types: [opened] +permissions: + issues: write + pull-requests: write jobs: - greeting: + welcome: runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write steps: - - name: Greet first-time contributors - id: greet - uses: actions/first-interaction@v1 + - uses: actions/checkout@v1 + - uses: EddieHubCommunity/gh-action-community/src/welcome@main with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: | - 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. - pr-message: | - 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. + github-token: ${{ secrets.GITHUB_TOKEN }} + 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." + 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." + + From efb77b2411ad6711565d3ce7936d486781792097 Mon Sep 17 00:00:00 2001 From: Anshika Yadav <14anshika7yadav@gmail.com> Date: Sun, 9 Jun 2024 23:44:31 +0530 Subject: [PATCH 2/2] Updated --- .github/workflows/greetings.yml | 38 +++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index fa59f0fa7..81e539f95 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -5,6 +5,7 @@ on: types: [opened] pull_request_target: types: [opened] + permissions: issues: write pull-requests: write @@ -12,12 +13,41 @@ permissions: jobs: welcome: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v1 - - uses: EddieHubCommunity/gh-action-community/src/welcome@main + - name: Check out repository + uses: actions/checkout@v2 + + - name: Greet first-time contributors + id: greet + uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: | + 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. + pr-message: | + 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. + + - name: Assign issue or pull request to team member + if: github.event_name == 'issues' || github.event_name == 'pull_request_target' + run: | + ISSUE_NUMBER=${{ github.event.issue.number || github.event.pull_request.number }} + curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -d '{"assignees":["team-member"]}' \ + "https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}" + + - name: Welcome message for community contributors + if: github.event_name == 'issues' || github.event_name == 'pull_request_target' + uses: EddieHubCommunity/gh-action-community/src/welcome@main with: github-token: ${{ secrets.GITHUB_TOKEN }} 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." 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." - - + + - name: Label first-time contributions + if: github.event_name == 'issues' || github.event_name == 'pull_request_target' + run: | + ISSUE_NUMBER=${{ github.event.issue.number || github.event.pull_request.number }} + curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -d '{"labels":["first-time contribution"]}' \ + "https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}" \ No newline at end of file