Update Lean and Mathlib #281
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: Update Lean and Mathlib | |
# Everyday attempt to update Lean and mathlib. If the update succeeds then deploy the updated version to the webpage. | |
on: | |
schedule: | |
- cron: "0 8 * * *" # every day at 8:00 UTC | |
workflow_dispatch: # allows workflow to be triggered manually | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
pull-requests: write | |
issues: write | |
outputs: | |
updated: ${{ steps.update-tactic-list.outputs.files_changed }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Update Lean project | |
id: update-lean-mathlib | |
uses: oliver-butterley/lean-update@v1-alpha | |
with: | |
on_update_fails: issue | |
- name: When update succeeds generate markdown file | |
if: steps.update-lean-mathlib.outputs.result == 'update-success' | |
id: update-tactic-list | |
run: | | |
./scripts/build.ps1 | |
python3 script.py | |
$diff = git diff -w "docs" | |
if ([string]::IsNullOrEmpty($diff)) { | |
"files_changed=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
} else { | |
"files_changed=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
} | |
Get-Content $env:GITHUB_OUTPUT | |
shell: pwsh | |
- name: Create Pull Request | |
if: steps.update-lean-mathlib.outputs.result == 'update-success' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: "generated by GitHub Action" | |
committer: "GitHub Action <[email protected]>" | |
author: "GitHub Action <[email protected]>" | |
branch: auto-update-branch | |
title: "Lean/Mathlib update" | |
body: "This PR is generated automatically by GitHub Action to update lean/mathlib version." | |
labels: auto-update |