fix(ci): replace free-text helm version input with dropdown#276
Open
bhavyamsharmaa wants to merge 1 commit into
Open
fix(ci): replace free-text helm version input with dropdown#276bhavyamsharmaa wants to merge 1 commit into
bhavyamsharmaa wants to merge 1 commit into
Conversation
ff37da3 to
d76a5d3
Compare
The helm-release workflow used a plain text input for the version, which allowed anyone to type any string, including versions that do not exist as real releases. This change switches the input to type: choice so only versions that appear in the official GitHub releases can be selected. The initial options list is seeded with the current releases. A new sync-helm-versions workflow is added to keep the choices list up to date. It runs automatically whenever a new release is published and can also be triggered manually. It fetches the latest 20 release tags and rewrites the options block in helm-release.yml. The existing validate-version job is kept as a safety net for workflow_dispatch calls made via the API where a choice input does not restrict the value. Closes crossplane-contrib#208 Signed-off-by: Bhavyam Sharma <positionbhavyamsharma@gmail.com>
d76a5d3 to
8f4dd9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #208
What changed
The helm-release workflow had a plain text input for the version field. This meant anyone could type any string, including versions that do not match any real release. The only guard was a validation step that ran after the workflow started.
This PR changes the version input to
type: choiceso the GitHub Actions UI shows a dropdown instead of a text box. Users can only pick from the list, so it is no longer possible to enter a made-up version.Two files are changed:
helm-release.yml - the
versioninput type is changed fromstringtochoice. The options list is seeded with the current 17 release tags from the repository.sync-helm-versions.yml (new) - a workflow that keeps the dropdown list up to date. It runs automatically whenever a new release is published on GitHub. It can also be run manually. It fetches the 20 most recent release tags and rewrites the options block in helm-release.yml, then commits the result.
The existing
validate-versionjob is kept as it is. It acts as a safety net for cases where the workflow is triggered via the API directly (e.g.gh workflow run), where a choice input does not restrict what value is passed.How it works
When a release is published,
sync-helm-versions.ymlruns and updates the options list inhelm-release.yml. The next time someone opens the helm-release workflow in the GitHub UI, the dropdown will show the updated list.Testing
sync-helm-versionsmanually and verify it updates the options in helm-release.yml and commits the change.