autoImplicit
オプションを紹介する
#232
Workflow file for this run
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: sync exercise and solutions | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
sync_exercise: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Install elan | |
run: | | |
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: run mk_exercise | |
run: | | |
rm -r Exercise | |
lake run mk_exercise | |
- name: detect diff | |
id: diff | |
run: | | |
git add -N Exercise | |
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 Exercise | |
git commit -m "generated by GitHub Action" | |
git push origin HEAD:${{ github.event.pull_request.head.ref }} |