-
Notifications
You must be signed in to change notification settings - Fork 39
30 lines (30 loc) · 1.48 KB
/
format_pr.yml
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
name: Code Formatting
on:
push:
branches:
- master
# workflow_dispatch: # intentionally disabled
jobs:
format_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the JuliaFormatter package
run: julia --color=yes -e 'using Pkg; Pkg.add(name = "JuliaFormatter", uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899")'
- name: Precompile dependencies
run: julia --color=yes -e 'using Pkg; Pkg.precompile()'
- name: Use JuliaFormatter to format the code with the BlueStyle style
run: julia --color=yes -e 'using JuliaFormatter; format(".", BlueStyle(); verbose = true)'
- name: Create pull request
id: create_pr
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '🤖 Automatically format the source code files'
title: '🤖 Automatically format the source code files'
body: 'This pull request formats the source code files using the JuliaFormatter package.'
# branch: bot/format_pr/${{ github.ref }} # broken, for some reason
branch: bot/format_pr/master # okay to hardcode master, since we disabled workflow_dispatch
delete-branch: true
- run: echo "The pull request number is ${{ steps.create_pr.outputs.pull-request-number }}"
- run: echo "The pull request URL is ${{ steps.create_pr.outputs.pull-request-url }}"