diff --git a/.github/CONTRIBUTING.rst b/.github/CONTRIBUTING.rst index cd6871452a2..dcd954648e6 100644 --- a/.github/CONTRIBUTING.rst +++ b/.github/CONTRIBUTING.rst @@ -108,6 +108,13 @@ Here's how to make a one-off code change. $ git add your-file-changed.py + - If your PR comes from a fork, create the chango fragment manually before pushing + (the chango workflow cannot auto-commit to fork branches): + + .. code-block:: bash + + $ uv run chango new --slug pr-1234-fix-telegram-api-error + - Finally, push it to your GitHub fork, run: .. code-block:: bash diff --git a/.github/workflows/chango.yml b/.github/workflows/chango.yml index 0f14d8f819a..03f7980a8a5 100644 --- a/.github/workflows/chango.yml +++ b/.github/workflows/chango.yml @@ -43,7 +43,10 @@ jobs: # 2. it ensures that the push will also re-trigger workflows github-token: ${{ secrets.CHANGO_PAT }} query-issue-types: true - commit-and-push: ${{ steps.check_title.outputs.COMMIT_AND_PUSH }} + # Don't try to commit & push for PRs from forks - the action can't push to a fork's + # branch (no write access), which would fail the job. For fork PRs, contributors must + # add the chango fragment manually. + commit-and-push: ${{ steps.check_title.outputs.COMMIT_AND_PUSH == 'true' && github.event.pull_request.head.repo.full_name == github.repository }} # Run `chango release` if applicable - needs some additional setup. - name: Set up Python