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

Github Actions - Validate tvdb seasons for PRs #98

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

evie-lau
Copy link

@evie-lau evie-lau commented Jan 7, 2025

Add script and github actions to validate user-inputted seasons in PRs against TVDB seasons.

ie. if user specifies a season number that doesn't exist in TVDB for the show, the script will fail the build for the PR.

!!Requires settings a TVDB api key in the repo secrets for actions

image

Technical details

  • runs a diff of the PR against the main branch for series-tvdb.en.yaml, creates a temp.yaml with context of 20 lines before/after the change.
  • extracts whole entries from the git diff
  • loads API key env var
  • goes through each entry, compares to TVDB to see if the TVDB metadata contains the season added by the user in the PR

Notes

The first step in the actions is to prevent someone from changing the python script to print the API key in the publicly viewable Github Actions log. Please let me know who to add to trusted authors.

@evie-lau
Copy link
Author

evie-lau commented Jan 7, 2025

Example of action running: evie-lau#1
image

@evie-lau
Copy link
Author

evie-lau commented Jan 8, 2025

Considering creating a copy/modifying the script to also do the same with TMDB, but for a separate PR

@Soitora Soitora assigned Soitora and reconman and unassigned Soitora Jan 8, 2025
@Soitora
Copy link
Collaborator

Soitora commented Jan 8, 2025

Considering creating a copy/modifying the script to also do the same with TMDB, but for a separate PR

Would be nice

@Soitora Soitora marked this pull request as draft February 2, 2025 15:15
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

Successfully merging this pull request may close these issues.

5 participants