Bump External Releases #1438
This file contains 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: Bump External Releases | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: 0 0 * * * # every day at midnight | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: hmarr/debug-action@v3 | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Configure git configs | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Samuele Maci (bot)" | |
- name: Install Python dependencies | |
run: pip install pre-commit | |
- name: Bump External Releases (tool) | |
run: | | |
python .github/workflows/bump_external_releases.py | |
echo "::set-env GIT_SHA=$(git rev-parse HEAD)" | |
- name: Create Pull Request | |
id: cpr | |
if: ${{ env.GIT_SHA != github.sha }} | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.REPO_TOKEN }} | |
title: '[Automated PR] Bump external tools (KTLint, Google Java Formatter, ktfmt, Pantlir)' | |
body: | | |
*Auto-generated* by [bump-releases](https://github.com/macisamuele/language-formatters-pre-commit-hooks/actions/workflows/bump-releases.yaml) | |
assignees: macisamuele | |
branch: create-pull-request/bump-releases | |
delete-branch: true | |
draft: false | |
- name: Auto approve Pull Request | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Automerge Pull Request | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v3 | |
with: | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
- name: Provide PR details | |
run: echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | |
if: success() |