Skip to content

Commit 86198ef

Browse files
authored
Merge pull request #114 from leanprover-community/develop
new toolchain in title/body of PR/issue
2 parents 0b88e69 + 38b89e2 commit 86198ef

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

action.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,27 @@ runs:
182182
# when update is successful #
183183
# ------------------------- #
184184
- name: Open PR if the updated lean build was successful
185-
if: steps.build-lean.outcome == 'success' && inputs.on_update_succeeds == 'pr' && steps.check-update.outputs.do_update == 'true'
185+
if: steps.build-lean.outcome == 'success' &&
186+
inputs.on_update_succeeds == 'pr' &&
187+
steps.check-update.outputs.do_update == 'true' &&
188+
steps.check-update.outputs.lean_toolchain_updated == 'true'
189+
uses: peter-evans/create-pull-request@v7
190+
with:
191+
title: "Updates available and ready to merge"
192+
body: |
193+
The `lean-toolchain` file has been updated to the following version:
194+
```
195+
${{ steps.record-latest-lean.outputs.latest_lean }}
196+
```
197+
delete-branch: true
198+
branch: auto-update-lean/patch
199+
labels: "auto-update-lean"
200+
201+
- name: Open PR if the updated lean build was successful
202+
if: steps.build-lean.outcome == 'success' &&
203+
inputs.on_update_succeeds == 'pr' &&
204+
steps.check-update.outputs.do_update == 'true' &&
205+
steps.check-update.outputs.lean_toolchain_updated == 'false'
186206
uses: peter-evans/create-pull-request@v7
187207
with:
188208
title: "Updates available and ready to merge"

scripts/checkChanges.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ if (updateIfModified === 'lean-toolchain') {
4646
const result = {
4747
files_changed: changedFiles.length > 0,
4848
do_update: doUpdate,
49-
changed_files: changedFiles.join(' ')
49+
changed_files: changedFiles.join(' '),
50+
lean_toolchain_updated: fileChanges['lean-toolchain']
5051
};
5152

5253
console.log('info:', JSON.stringify(result, null, 2));
@@ -57,4 +58,5 @@ if (githubOutput) {
5758
fs.appendFileSync(githubOutput, `files_changed=${result.files_changed}\n`);
5859
fs.appendFileSync(githubOutput, `changed_files=${result.changed_files}\n`);
5960
fs.appendFileSync(githubOutput, `do_update=${result.do_update}\n`);
61+
fs.appendFileSync(githubOutput, `lean_toolchain_updated=${result.lean_toolchain_updated}\n`);
6062
}

0 commit comments

Comments
 (0)