name: Mention on Pull Request
# Define the permissions here
permissions:
issues: write # This allows commenting on issues and pull requests
pull-requests: write # This ensures write access to pull requests
on:
pull_request:
branches:
- '**' # Ensure it runs on all branches
types: [opened, reopened, synchronize]
jobs:
mention:
runs-on: ubuntu-latest
steps:
- name: Comment on the PR
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-X POST \
-d "{\"body\": \"Hey @your-username, there's a new pull request!\"}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/comments"