Skip to content

Commit 1a4e641

Browse files
committed
add formatting PR
1 parent 1d53a36 commit 1a4e641

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/format_pr.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# https://github.com/julia-actions/julia-format/blob/master/workflows/format_pr.yml
2+
name: format-pr
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install JuliaFormatter and format
14+
run: |
15+
julia -e 'import Pkg; Pkg.add("JuliaFormatter")'
16+
julia -e 'using JuliaFormatter; format(".")'
17+
# https://github.com/marketplace/actions/create-pull-request
18+
# https://github.com/peter-evans/create-pull-request#reference-example
19+
- name: Create Pull Request
20+
id: cpr
21+
uses: peter-evans/create-pull-request@v3
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
commit-message: ":robot: Format .jl files"
25+
title: '[AUTO] JuliaFormatter.jl run'
26+
branch: auto-juliaformatter-pr
27+
delete-branch: true
28+
labels: formatting, automated pr, no changelog
29+
- name: Check outputs
30+
run: |
31+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
32+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

0 commit comments

Comments
 (0)