Skip to content

Update README.md

Update README.md #4

Workflow file for this run

name: Hacktoberfest PR Comment
on:
pull_request:
types:
- closed
jobs:
hacktoberfest-pr-comment:
runs-on: ubuntu-latest
steps:
- name: Check for Hacktoberfest label
id: check-label
uses: actions/labeler@v4
with:
label: hacktoberfest-accepted
action: exists
repo-token: ${{ secrets.GH_ACTIONS }}
- name: Debug outputs
run: |
echo "Actions: ${{ secrets.GH_ACTIONS }}"
echo "Label exists: ${{ steps.check-label.outputs.exists }}"
echo "PR merged: ${{ github.event.pull_request.merged }}"
echo "PR number: ${{ github.event.pull_request.number }}"
echo "PR author: ${{ github.event.pull_request.user.login }}"
- name: Comment on Hacktoberfest PR
if: steps.check-label.outputs.exists == 'true' && github.event.pull_request.merged == true
run: |
PR_NUMBER="${{ github.event.pull_request.number }}"
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
COMMENT_BODY="Congratulations @${PR_AUTHOR} on your Hacktoberfest PR! 🎉\n\n![Hacktoberfest Badge](./badges/hacktoberfest-badge.png)"
# Set up the GitHub CLI
GITHUB_TOKEN="${{ secrets.GH_ACTIONS }}"
echo "$COMMENT_BODY" | gh pr comment $PR_NUMBER -R $GITHUB_REPOSITORY --token $GITHUB_TOKEN