-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add a manual (
workflow_dispatch
) workflow for fixing code forma…
…tting (#146)
- Loading branch information
1 parent
2768c5e
commit e973ada
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Fix format | ||
on: | ||
workflow_dispatch: | ||
concurrency: | ||
# Skip intermediate builds: all builds except for builds on the `master` branch | ||
# Cancel intermediate builds: only pull request builds | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
fix-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
with: | ||
persist-credentials: true # we intentionally set this to true, since we plan on committing and pushing later | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: '1' | ||
- run: make format-fix | ||
- name: Create pull request | ||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 | ||
with: | ||
token: '${{ secrets.GITHUB_TOKEN }}' | ||
commit-message: "🤖 Automatic code formatting" | ||
committer: "GitHub Actions CI <[email protected]>" | ||
title: "🤖 Automatic code formatting" | ||
body: | | ||
This pull request fixes the code formatting of the Julia files in branch ${{ github.ref_name }}. | ||
Auto-generated by [create-pull-request][1]. | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
branch: create-pull-request/fixformat/${{ github.ref_name }} | ||
delete-branch: true |