Reduce Frequence of Renovate Updates for Development Dependencies #679
Workflow file for this run
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: Chango | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| permissions: {} | |
| jobs: | |
| create-chango-fragment: | |
| permissions: | |
| # Give the default GITHUB_TOKEN write permission to commit and push the | |
| # added or changed files to the repository. | |
| contents: write | |
| name: Create chango Fragment | |
| runs-on: ubuntu-latest | |
| outputs: | |
| IS_RELEASE_PR: ${{ steps.check_title.outputs.IS_RELEASE_PR }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| # needed for commit and push step at the end | |
| persist-credentials: true | |
| - name: Check PR Title | |
| id: check_title | |
| run: | # zizmor: ignore[template-injection] | |
| if [[ "$(echo "${{ github.event.pull_request.title }}" | tr '[:upper:]' '[:lower:]')" =~ ^bump\ version\ to\ .* ]]; then | |
| echo "COMMIT_AND_PUSH=false" >> $GITHUB_OUTPUT | |
| echo "IS_RELEASE_PR=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "COMMIT_AND_PUSH=true" >> $GITHUB_OUTPUT | |
| echo "IS_RELEASE_PR=false" >> $GITHUB_OUTPUT | |
| fi | |
| # Create the new fragment | |
| - uses: Bibo-Joshi/chango@617976e1706dc9a72ea40e529d4b1dcc433d4e22 # 0.6.0 | |
| with: | |
| # passing this custom token has two purposes | |
| # 1. it allows us to fetch info about issue types | |
| # 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 }} | |
| # Run `chango release` if applicable - needs some additional setup. | |
| - name: Set up Python | |
| if: steps.check_title.outputs.IS_RELEASE_PR == 'true' | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: "3.x" | |
| - name: Do Release | |
| if: steps.check_title.outputs.IS_RELEASE_PR == 'true' | |
| run: | | |
| cd ./target-repo | |
| git add changes/unreleased/* | |
| pip install . --group docs | |
| VERSION_TAG=$(python -c "from telegram import __version__; print(f'{__version__}')") | |
| chango release --uid $VERSION_TAG | |
| - name: Commit & Push | |
| if: steps.check_title.outputs.IS_RELEASE_PR == 'true' | |
| uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0 | |
| with: | |
| commit_message: "Do chango Release" | |
| repository: ./target-repo |