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

Add support tooling to easily trigger update from custom GSheet menu (app script) #5

Open
3 tasks
patcon opened this issue Nov 15, 2024 · 0 comments
Open
3 tasks

Comments

@patcon
Copy link
Contributor

patcon commented Nov 15, 2024

GitHub Actions have a trigger called workflow_dispatch that, when enabled, allows not only kicking off a run from the "Actions" tab of the GitHub UI, but ALSO allow manual trigger with POST request to GitHub API.

We could use this to allow triggering of runs from a custom menu of a Google Sheet (#4), which is something that can be done quite trivially with Google App Script language.

An example of a custom menu item doing a similar thing in another project I worked on:

Screenshot 2024-11-14 at 5 16 56 PM

Caveat:

  • since a GitHub access token (to kick off the GitHub sync workflow) would need to be accessible to the Google App script attached to the spreadsheet, the token would be available to anyone with edit access on the sheet. This means:
    1. public sheet would need to be only world-readable, so that random ppl couldn't view the app script. So any changes would have to happen through comments/suggestions, OR
    2. public sheet could be world-editable bc YOLO what's the worst that could happen if someone really dug into the app-script code (reducing permission scope of GitHub token might make risk negligible)

Tutorial for kicking off GitHub Actions from Google App Scripts: https://www.jaredwhalen.com/blog/deploy-gh-action-from-sheets

Specifically, this task would involve

  • add workflow_dispatch trigger to workflow config
  • writing the app script and version controlling it here for copying, and
  • documentation
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

No branches or pull requests

1 participant