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

Make auto updates run as a GitHub action #821

Merged
merged 1 commit into from
Dec 22, 2024
Merged

Conversation

tidoust
Copy link
Collaborator

@tidoust tidoust commented Oct 14, 2024

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:

  • The following variables must be defined at the repo level:
    • BOT_NAME, set to the GitHub account of the bot (typically: specworker)
    • BOT_EMAIL, set to the email of the bot
  • The following secret must be defined at the repo level:
    • BOT_TOKEN, set to a "Personal access token (classic)" with public_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 the update-all script will re-generate package-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 make update-all ignore changes made to package-lock.json when it pushes updates to the main branch.

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:
- The following *variables* must be defined at the repo level:
  * `BOT_NAME`, set to the GitHub account of the bot (typically: specworker)
  * `BOT_EMAIL`, set to the email of the bot
- The following *secret* must be defined at the repo level:
  * `BOT_TOKEN`, set to a "Personal access token (classic)" with `public_repo`
  scope in the GitHub account of the bot

(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.
@tidoust tidoust requested a review from tobie October 14, 2024 12:44
@tobie tobie merged commit 700df8f into tobie:main Dec 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants