-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (38 loc) · 1.14 KB
/
fmt.yml
File metadata and controls
40 lines (38 loc) · 1.14 KB
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
---
name: Reformat code
on:
push:
branches-ignore:
- main
- master
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up ruff
run: curl -LsSf https://astral.sh/ruff/0.15.5/install.sh | sh
- name: Reformat and push
shell: bash
run: |-
ruff check --fix
ruff format
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
timestamp=$(date -u)
git commit -am "ruff: ${timestamp}" || exit 0
git push
echo "COMMITTED=1" >> "$GITHUB_ENV"
- name: "Trigger build"
run: |-
if [ -z "$COMMITTED" ]; then
echo "No commit"
exit 0
fi
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/exoscale/python-exoscale/actions/workflows/main.yml/dispatches \
-d '{"ref": "'${{ github.ref }}'"}'