Skip to content

Implement hands-on T8L4/hp-remote-branch-rename #45

Implement hands-on T8L4/hp-remote-branch-rename

Implement hands-on T8L4/hp-remote-branch-rename #45

name: Post contribution message in pull request
on:
pull_request_target:
types: [opened, reopened]
permissions:
# Only scope GITHUB_TOKEN to write for pull requests, others set to none (by default) for security reasons since we are using pull_request_target trigger
pull-requests: write
jobs:
post_contribution_message:
runs-on: ubuntu-latest
steps:
# DO NOT CHECKOUT TO HEAD UNSAFE (will checkout to head of the fork for pull_request_target trigger)
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
pip install requests PyGithub
- name: Run post contribution message script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
COMMIT_AUTHOR: ${{ github.event.pull_request.user.login }}
FORK_AUTHOR: ${{ github.event.pull_request.head.repo.owner.login }}
FORK_REPO: ${{ github.event.pull_request.head.repo.name }}
FORK_BRANCH: ${{ github.event.pull_request.head.ref }}
run: |
python scripts/post-contribution-message.py