-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
ππ» 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
- 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
- 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
- create sync flow using GitHub App
- Create new workflow in
open-sauced/open-sauced
with a schedule trigger. - We will need to put a
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. - 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 thedata.json
file if there is any change. - Use
@octokit/plugin-create-or-update-text-file
to simplify the process of loading and updating the files - Optimization: batch load statistics for 100 repositories at once using a single GraphQL query
- Create new workflow in
- Bonus
- create a script that creats pull request to all existing
*/open-sauced-goals
repositories which removes thescheduled-caching.yml
workflow file usingoctokit-plugin-create-pull-request
- create a script that creats pull request to all existing
TODOs
Before the show
- @bdougie add GitHub App credentials of Open Sauced GitHub App to the
open-sauced/open-sauced
repository by settingOPEN_SAUCED_APP_ID
andOPEN_SAUCED_PRIVATE_KEY
- 30 minute announcement tweet
(https://twitter.com/gr2m/status/1421132031413604354) - 30 minute announcement comment
(π 7/30 @ 9am PT - Running scheduled GitHub App tasks using ActionsΒ #38 (comment))
When show begins
- start of show tweet
(https://twitter.com/gr2m/status/1421138052399960064) - comment on issue
(π 7/30 @ 9am PT - Running scheduled GitHub App tasks using ActionsΒ #38 (comment)) - Set twitter profile url to https://twitch.tv/gregorcodes
(https://twitter.com/gr2m)
After the show
- Reset twitter profile after the show
(https://twitter.com/gr2m) - recording available tweet
Recording
will be added after the show
Shownotes
- This is the repository we worked on: https://github.com/open-sauced/actions/