You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opensauced.pizza is your dashboard to plan and track your Open Source contributions. It works by forking the open-sauced/goals-template repository, which includes the goals-caching.yml workflow to synchronize data every two days. Besides the workflow, the @open-sauced app is installed as well which acts on direct interactions with the repository.
In this show, we will try to remove the goals-caching.yml workflow from the template repository, and instead do the synchronization with the app, which is already installed. Apps do not have a native schedule trigger such as actions, but we can utilize a GitHub Action to authenticate as the app, and synchronize all repositories the app is installed on in one go.
Outline
show the current flow
Add a new repository, star repository, show out-of-sync stars in open sauced dashboard. Run sync using the scheduled sync action by adding a workflow_dispatch trigger
We will need to put a update-open-sauced-goals-cache.js somewhere in the repository, and we need to install octokit as dependency. We'll need to checkout the repository and setup Node 16 before running the script.
In the script, we will iterate all repositories of each installation. Load the data.json file for each repository, load the latest stats for each repository, then update the data.json file if there is any change.
Optimization: batch load statistics for 100 repositories at once using a single GraphQL query
Bonus
create a script that creats pull request to all existing */open-sauced-goals repositories which removes the scheduled-caching.yml workflow file using octokit-plugin-create-pull-request
ππ» Running scheduled GitHub App tasks using Actions
π Friday, July 30, 2021
π 9:00am Pacific Time (in your timezone)
ποΈ Hosted by @bdougie
π https://www.twitch.tv/github
π·οΈ Automation
Subscribe to this issues to get a notification before the show begins and a summary after the show concludes. You can also sign up for the event on https://www.meetup.com/Open-Sauced-Meetup/events/279608849
Running scheduled GitHub App tasks using Actions
opensauced.pizza is your dashboard to plan and track your Open Source contributions. It works by forking the open-sauced/goals-template repository, which includes the
goals-caching.yml
workflow to synchronize data every two days. Besides the workflow, the @open-sauced app is installed as well which acts on direct interactions with the repository.In this show, we will try to remove the
goals-caching.yml
workflow from the template repository, and instead do the synchronization with the app, which is already installed. Apps do not have a native schedule trigger such as actions, but we can utilize a GitHub Action to authenticate as the app, and synchronize all repositories the app is installed on in one go.Outline
workflow_dispatch
triggeropen-sauced/open-sauced
with a schedule trigger.update-open-sauced-goals-cache.js
somewhere in the repository, and we need to installoctokit
as dependency. We'll need to checkout the repository and setup Node 16 before running the script.data.json
file for each repository, load the latest stats for each repository, then update thedata.json
file if there is any change.@octokit/plugin-create-or-update-text-file
to simplify the process of loading and updating the files*/open-sauced-goals
repositories which removes thescheduled-caching.yml
workflow file usingoctokit-plugin-create-pull-request
TODOs
Before the show
open-sauced/open-sauced
repository by settingOPEN_SAUCED_APP_ID
andOPEN_SAUCED_PRIVATE_KEY
(https://twitter.com/gr2m/status/1421132031413604354)
(π 7/30 @ 9am PT - Running scheduled GitHub App tasks using Actions #38 (comment))
When show begins
(https://twitter.com/gr2m/status/1421138052399960064)
(π 7/30 @ 9am PT - Running scheduled GitHub App tasks using Actions #38 (comment))
(https://twitter.com/gr2m)
After the show
(https://twitter.com/gr2m)
Recording
will be added after the show
Shownotes
The text was updated successfully, but these errors were encountered: