Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow updating stage0 via workflow_dispatch #3052

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/update-stage0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
push:
branches:
- 'master'
workflow_dispatch:

concurrency:
group: stage0
Expand All @@ -23,16 +24,17 @@ jobs:
- uses: actions/checkout@v3
with:
ssh-key: ${{secrets.STAGE0_SSH_KEY}}
- name: Check if update is needed
- run: echo "DOIT=yes" >> "$GITHUB_ENV"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super excited that the flag is named DOIT here!

Copy link
Contributor Author

@nomeata nomeata Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to change, any suggestions?

(Is DOIT somehow culturally inappropriate in a way I didn't see, or otherwise not good?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is should_update_stage0 better?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just unclear. (I have a vendetta against 'it'.)

- name: Check if automatic update is needed
if: github.event_name == 'push'
run: |
if diff -u src/stdlib_flags.h stage0/src/stdlib_flags.h
then
echo "src/stdlib_flags.h and stage0/src/stdlib_flags.h agree, nothing to do"
echo "DOIT=no" >> "$GITHUB_ENV"
else
echo "DOIT=yes" >> "$GITHUB_ENV"
fi
- name: Setup git user
if: env.DOIT == 'yes'
run: |
git config --global user.name "Lean stage0 autoupdater"
git config --global user.email "<>"
Expand All @@ -52,9 +54,9 @@ jobs:
run: nix run .#update-stage0-commit
- if: env.DOIT == 'yes'
run: git show --stat
- if: env.DOIT == 'yes'
- if: env.DOIT == 'yes' && github.event_name == 'push'
name: Sanity check # to avoid loops
run: |
diff -u src/stdlib_flags.h stage0/src/stdlib_flags.h || exit 1
- if: env.DOIT == 'yes'
run: git push origin HEAD:master
run: git push origin