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

πŸ“… 7/30 @ 9am PT - Running scheduled GitHub App tasks using Actions #38

Closed
7 of 8 tasks
gr2m opened this issue Jul 21, 2021 · 4 comments
Closed
7 of 8 tasks
Labels
show Preparation issue for a live show

Comments

@gr2m
Copy link
Owner

gr2m commented Jul 21, 2021

πŸ’πŸ» 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
  • 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 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.
    • 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
  • 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

TODOs

Before the show

When show begins

After the show

Recording

will be added after the show

Shownotes

@gr2m gr2m added the show Preparation issue for a live show label Jul 21, 2021
@gr2m

This comment has been minimized.

@gr2m

This comment has been minimized.

@gr2m
Copy link
Owner Author

gr2m commented Jul 30, 2021

The show is done, I'll post a link once @bdougie uploads the video to YouTube

@gr2m gr2m closed this as completed Jul 30, 2021
@gr2m
Copy link
Owner Author

gr2m commented Jul 30, 2021

Show is done for today, thank you all! Recording is coming up in a moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
show Preparation issue for a live show
Projects
None yet
Development

No branches or pull requests

1 participant