-
Notifications
You must be signed in to change notification settings - Fork 58
55 lines (52 loc) · 1.95 KB
/
bump-releases.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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()