-
Notifications
You must be signed in to change notification settings - Fork 21
49 lines (41 loc) · 1.13 KB
/
mk_exercise.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
name: Make Exercise
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'yuma-mizuno'
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install elan
run: |
set -o pipefail
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: make exercise
run: lake exe mk_exercise Solution Tutorial
- name: diff
id: diff
run: |
git add -N Tutorial
git diff --name-only --exit-code
continue-on-error: true
- name: commit
if: steps.diff.outcome == 'failure'
run: |
git config user.name "GitHub Action"
git config user.email "[email protected]"
git add Tutorial
git commit -m "generated by GitHub Action"
git push