File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ # This workflow runs on every push and automatically applies formatting using mise format
2+ name : Auto-format code
3+
4+ concurrency :
5+ group : ${{ github.workflow }}-${{ github.ref }}
6+ cancel-in-progress : true
7+
8+ on :
9+ push :
10+ branches :
11+ - " **"
12+
13+ jobs :
14+ format :
15+ runs-on : ubuntu-24.04-arm
16+ permissions :
17+ # Give the default GITHUB_TOKEN write permission to commit and push the
18+ # added or changed files to the repository.
19+ contents : write
20+ # Only run on the main repo, skip forks
21+ # Skip if commit is already from this auto-format workflow to avoid infinite loops
22+ if : github.repository == 'ChainSafe/forest' && !contains(github.event.head_commit.message, '[LeshyBot] Apply automatic formatting')
23+ steps :
24+ - uses : actions/create-github-app-token@v2
25+ id : generate-token
26+ with :
27+ app-id : ${{ secrets.LESHY_APP_ID }}
28+ private-key : ${{ secrets.LESHY_APP_PRIVATE_KEY }}
29+
30+ - uses : actions/checkout@v6
31+ with :
32+ token : ${{ steps.generate-token.outputs.token }}
33+ fetch-depth : 0
34+
35+ - uses : jdx/mise-action@v3
36+ - run : mise install-lint-tools
37+ - run : mise format
38+
39+ - name : Commit and push formatting changes
40+ uses : stefanzweifel/git-auto-commit-action@v5
41+ with :
42+ commit_message : " [LeshyBot] Apply automatic formatting"
43+ commit_user_name : " leshyatwork[bot]"
44+ commit_user_email : " 217592034+leshyatwork[bot]@users.noreply.github.com"
45+ commit_author : " leshyatwork[bot] <217592034+leshyatwork[bot]@users.noreply.github.com>"
You can’t perform that action at this time.
0 commit comments