Make auto updates run as a GitHub action #821
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The script that updates the contents of Specref currently runs as a cron job on a server. On top of costing a bit of money, this means that there is no easy way to be notified about failures to update, and no easy way to access the logs when an update fails. This update makes the
update-all
script as part of a GitHub action instead.Preliminaries:
BOT_NAME
, set to the GitHub account of the bot (typically: specworker)BOT_EMAIL
, set to the email of the botBOT_TOKEN
, set to a "Personal access token (classic)" withpublic_repo
scope in the GitHub account of the bot@tobie, setting these variables and secret is up to you:
(The bot account must of course have write permission on the repository. That is already the case for specworker).
The script runs every hour. It may also be triggered manually from the user interface on GitHub.
I confirmed that the workflow runs correctly on my repository. Please note however that the call to
npm install
means that theupdate-all
script will re-generatepackage-lock.json
upon first run, because it follows an obsolete format. I created #820 to make that update explicit and discuss possible consequences. If #820 cannot be merged beforehands, I'll update this PR to makeupdate-all
ignore changes made topackage-lock.json
when it pushes updates to the main branch.