Skip to content

Fixed issue in greeting.yml workflow #874 #884

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
merged 2 commits into from
Jun 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
name: Greetings
name: 'Greetings'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace your code to

name: 'Greetings'

on:
  issues:
    types: [opened]
  pull_request_target:
    types: [opened]

permissions:
  issues: write
  pull-requests: write

jobs:
  welcome:
    runs-on: ubuntu-latest

    steps:
      - 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}"

for performing all task

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: Check out repository
uses: actions/checkout@v2

- name: Greet first-time contributors
id: greet
uses: actions/first-interaction@v1
Expand All @@ -18,3 +27,27 @@ jobs:
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}"
Loading