-
Notifications
You must be signed in to change notification settings - Fork 41
55 lines (46 loc) · 1.42 KB
/
Format.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: 'Format'
on:
pull_request_target:
paths: ['**/*.jl']
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
# needed for julia-actions/cache to delete old caches
actions: write
# needed for googleapis/code-suggester
pull-requests: write
jobs:
runic:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: 'x64'
- uses: julia-actions/cache@v2
- name: Install Runic
run: |
julia --project=@runic -e 'using Pkg; Pkg.add("Runic")'
curl -o git-runic https://raw.githubusercontent.com/fredrikekre/Runic.jl/master/bin/git-runic
chmod +x git-runic
sudo mv git-runic /usr/local/bin
- name: Run Runic
run: |
set +e
git runic origin/main
[ $? -eq 2 ] && exit 1 || exit 0
- name: Suggest changes
uses: googleapis/code-suggester@v2
env:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: review
pull_number: ${{ github.event.pull_request.number }}
git_dir: '.'