Skip to content

Commit

Permalink
chore: bot validates lean-toolchain on bump/v4.X.0 branches (#20478)
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Jan 5, 2025
1 parent a5ae671 commit 9837ca9
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions .github/workflows/nightly_detect_failure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,40 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const response = await github.rest.repos.getContent({
owner: context.repo.owner,
repo: context.repo.repo,
path: 'lean-toolchain',
ref: ${{ steps.latest_bump_branch.outputs.result }}
});
const content = Buffer.from(response.data.content, 'base64').toString();
const version = content.match(/leanprover\/lean4:nightly-(\d{4}-\d{2}-\d{2})/)[1];
return version;
try {
const response = await github.rest.repos.getContent({
owner: context.repo.owner,
repo: context.repo.repo,
path: 'lean-toolchain',
ref: ${{ steps.latest_bump_branch.outputs.result }}
});
const content = Buffer.from(response.data.content, 'base64').toString();
const match = content.match(/leanprover\/lean4:nightly-(\d{4}-\d{2}-\d{2})/);
if (!match) {
core.setFailed('Toolchain pattern did not match');
core.setOutput('toolchain_content', content);
return null;
}
return match[1];
} catch (error) {
core.setFailed(error.message);
return null;
}
- name: Send warning message on Zulip if pattern doesn't match
if: failure()
uses: zulip/github-actions-zulip/send-message@v1
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: '[email protected]'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing'
type: 'stream'
topic: 'Mathlib status updates'
content: |
⚠️ Warning: The lean-toolchain file in the latest bump branch does not match the expected pattern 'leanprover/lean4:nightly-YYYY-MM-DD'.
Current content: ${{ steps.bump_version.outputs.toolchain_content }}
This needs to be fixed for the nightly testing process to work correctly.
- name: Compare versions and post a reminder.
env:
Expand Down

0 comments on commit 9837ca9

Please sign in to comment.