Skip to content

Github Actions - Validate tvdb seasons for PRs#98

Draft
evie-lau wants to merge 17 commits into
RickDB:mainfrom
evie-lau:validateTvdbSeasons
Draft

Github Actions - Validate tvdb seasons for PRs#98
evie-lau wants to merge 17 commits into
RickDB:mainfrom
evie-lau:validateTvdbSeasons

Conversation

@evie-lau

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

Copy link
Copy Markdown
Contributor

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

evie-lau commented Jan 7, 2025

Copy link
Copy Markdown
Contributor Author

Example of action running: evie-lau#1
image

@evie-lau

evie-lau commented Jan 8, 2025

Copy link
Copy Markdown
Contributor Author

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

Soitora commented Jan 8, 2025

Copy link
Copy Markdown
Collaborator

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

Would be nice

Comment thread validate-tvdb-seasons.py Outdated
@Soitora Soitora marked this pull request as draft February 2, 2025 15:15
@Soitora

Soitora commented Jul 14, 2025

Copy link
Copy Markdown
Collaborator

I forgot, what is there missing here before it's ready?

@evie-lau

evie-lau commented Jul 15, 2025

Copy link
Copy Markdown
Contributor Author

Hmm, besides a TMDB counterpart, I don't think there was anything missing.

Just needs an admin to setup the TVDB API key as noted in the first comment.

@Soitora

Soitora commented Jul 15, 2025

Copy link
Copy Markdown
Collaborator

Would require @RickDB or @reconman since those are the ones with access to adding secrets

@reconman

Copy link
Copy Markdown
Collaborator

Would require @RickDB or @reconman since those are the ones with access to adding secrets

I don't have the rights either, only the owner can change secrets in user repositories.

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