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

πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: Twitch Events #52

Closed
12 tasks done
gr2m opened this issue Oct 14, 2021 · 4 comments
Closed
12 tasks done

πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: Twitch Events #52

gr2m opened this issue Oct 14, 2021 · 4 comments
Labels
automating helpdesk show Preparation issue for a live show

Comments

@gr2m
Copy link
Owner

gr2m commented Oct 14, 2021

πŸ’πŸ» Automating gr2m/helpdesk: Twitch Events
πŸ“… Thursday, October 21, 2021
πŸ• 10:00am Pacific Time
πŸŽ™οΈ no guests
πŸ“ https://www.twitch.tv/gregorcodes
🏷️ automation


Subscribe to this issues to get a notification before the show begins and a summary after the show concludes.

Automating gr2m/helpdesk: πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: Twitch Events

Instead of using a schedule-based trigger for when a show starts, I'll start using webhooks sent from Twitch itself, whenever I start a stream.

Outline

  • Create a new repository handle-twitch-events-using-github-actions with a Netlify Function that responds to /.netlify/functions/ping
  • Setup continuous deployment of the repository using Netlify's GitHub App
  • Add a script to list, create, and delete Twitch subscriptions
  • Add a Netlify Function that will handle Twitch EventSub requests at POST /.netlify/functions/twitch and create repository dispatch events
  • Add a GitHub Action that gets triggered by the repository dispatch events

Bonus

  • In the gr2m/helpdesk repository, rreplace the current schedule trigger for the Handle show start workflow with the custom trigger when the webhook is received
  • Replace the current issues.closed trigger for the Handle show done workflow with the custom trigger when the webhook is received. Close the show issue

TODOs

Before the show

I already setup the Netlify function and the twitch subscription in the gr2m/helpdesk. I'll prepare the pieces so we can create a new repository from scratch step-by-step.

When show begins

After the show

Recording

screenshot of YouTube video player showing the recording of this episode

Shownotes

@gr2m gr2m changed the title DO NOT EDIT - Await parsing by GitHub Actions πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: Twitch Events Oct 14, 2021
@gr2m gr2m added the show Preparation issue for a live show label Oct 14, 2021
@gr2m gr2m changed the title πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: Twitch Events DO NOT EDIT - Await parsing by GitHub Actions Oct 21, 2021
@gr2m gr2m changed the title DO NOT EDIT - Await parsing by GitHub Actions πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: Twitch Events Oct 21, 2021
@gr2m gr2m changed the title πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: Twitch Events πŸ“… 10/21 @ 10:00am PT - Automating gr2m/helpdesk: Twitch Events Oct 21, 2021
@gr2m
Copy link
Owner Author

gr2m commented Oct 21, 2021

Going live in 30 minutes at https://twitch.tv/gregorcodes

@gr2m
Copy link
Owner Author

gr2m commented Oct 21, 2021

I'm now live on https://twitch.tv/gregorcodes

@gr2m
Copy link
Owner Author

gr2m commented Oct 21, 2021

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

@gr2m gr2m closed this as completed Oct 21, 2021
@gr2m
Copy link
Owner Author

gr2m commented Oct 21, 2021

Recording is now live, I've also updated the shownotes

screenshot of YouTube video player showing the recording of this episode

Regarding the "Handle show done" workflow, that used the "issues.closed" trigger and is now using the "twitch.stream.offline" event: it didn't work 🀷🏼 The reason is that the payload the issues event has an .issue key which is all properties from the issue that was closed. That information is not available when using the repository_dispatch event, so I have to update the script to load the issue data for the current show manually.

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

No branches or pull requests

1 participant