Skip to content

Update Lean and Mathlib #134

Update Lean and Mathlib

Update Lean and Mathlib #134

Workflow file for this run

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 "src"
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 <action@github.com>"
author: "GitHub Action <action@github.com>"
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