Merge pull request #94 from django/remove-team-reviewers #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update changelog | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-changelog: | |
| if: github.actor != 'github-actions[bot]' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate changelog entry | |
| shell: bash | |
| run: | | |
| bash scripts/update_changelog.sh | |
| - name: Create and push branch with changelog update | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| set -euo pipefail | |
| if git diff --quiet -- CHANGELOG.md; then | |
| echo "No changelog updates to commit." | |
| exit 0 | |
| fi | |
| BRANCH="changelog-update-${{ github.run_number }}" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "${BRANCH}" | |
| git add CHANGELOG.md | |
| git commit -m "Update changelog" | |
| git push origin "${BRANCH}" | |
| gh pr create \ | |
| --title "Update changelog" \ | |
| --body "This PR updates the changelog with recent changes. | |
| Auto-generated by workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | |
| --base main \ | |
| --head "${BRANCH}" |