Merge pull request #41 from Seasawher/update-lean #12
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
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 |