Skip to content

Conversation

@lucydodo
Copy link
Member

@lucydodo lucydodo commented Aug 1, 2024

What type of PR is this?

  • Other

Description

When we needed to manually change the snapshot version, we had to run a few commands manually,
but this PR makes it a little easier. Once these PRs are merged, the following options are available in the 'Periodic Snapshot'.

Screenshot 2024-08-01 at 16 53 36 Each option causes the following behavior to occur:
  • 'Bump the...': Increate the last digit in the current version by 1
  • 'Specific...': Use the entered value as the new version.
  • If both options are selected, the CI will abort with the following error
Screenshot 2024-08-01 at 16 55 17

echo "::error::Error: Cannot specify both bump and specific version."

On a related note: this code is part of the syntax in GitHub Actions Workflow that outputs the error in the image above.

Why run the command below

gh workflow run preview-image.yml --ref $TAG_NAME

GitHub does not trigger existing workflows for commits, tags, etc. that changed with GH_TOKEN.
Therefore, I have specified to run the workflow manually, please refer the following article for more information:

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run.
Automatic token authentication - GitHub Docs

How is this tested?

  • Manually

I confirmed it works fine on my repo.

Related Tickets & Documents

Not applicable.

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

Not applicable.

Any comments or review are welcome. Thank you.

@lucydodo lucydodo added the CI label Aug 1, 2024
@lucydodo lucydodo self-assigned this Aug 1, 2024
@justinclift
Copy link
Member

This seems useful. 😄

@eradman You'll probably be interested in this, as it tweaks how the monthly tag name is done. Looks like a decent progression. 😄

@justinclift justinclift changed the title Add the option to take new custom version for snapshot Add the option to take new custom version for git tag Aug 1, 2024
@justinclift justinclift changed the title Add the option to take new custom version for git tag Add the option to take new custom version for Snapshot Aug 2, 2024
Copy link
Member

@justinclift justinclift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concept sounds decent to me, and the code looks fine too. 😄

@justinclift justinclift enabled auto-merge (squash) August 2, 2024 05:52
@justinclift justinclift merged commit a531597 into master Aug 2, 2024
@justinclift justinclift deleted the feat/custom-snapshot-version branch August 2, 2024 06:19
@eradman
Copy link
Collaborator

eradman commented Aug 2, 2024

I couldn't get this to work on my own repo: this is the result of checking "Bump the last digit of the version"

gh-workflow-1

@justinclift
Copy link
Member

Disabled workflow?

@lucydodo
Copy link
Member Author

lucydodo commented Aug 2, 2024

Hi @eradman,
Screenshot 2024-08-03 at 04 25 37

https://github.com/eradman/redash/actions/workflows/preview-image.yml

My guess is that you disabled the 'Preview Image' workflow yourself.
To the right of the search bar you see in the screenshot, there should be an option to re-enable it by pressing the menu button. Enable it and try again. I just checked and it still works fine for my repos. :)

@eradman
Copy link
Collaborator

eradman commented Aug 2, 2024

Thanks @justinclift @lucydodo! I enabled the "Preview Image" workflow and was able to run this manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants