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

Add additional parameters and move behavior into action.yml #18

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

Conversation

pwtyler
Copy link
Member

@pwtyler pwtyler commented Jan 24, 2025

  • Moves behavior into action.yml, removing shell script
  • Drops lint CI step.
  • Drops the expectation to pass gh-token (I think this should just work)
  • adds tag as output
  • Don't install autotag if already found

New input params

  • push-tag (bool): whether to push the tag or not
  • push-major-version-branch (bool): whether to push to a major version (i.e. v1) branch
  • v-prefix (bool): whether to prefix the tag with v or not
  • create-release (bool): whether or not to create a release. Should allow "draft" in a future release.
  • workdir: directory with the code to tag

The input params have been set such that the default behavior matches current behavior— we should determine which, if any, should be flipped as part of released a v1.


TODO

  • Move longer sections back into shell scripts
  • Docs

@pwtyler
Copy link
Member Author

pwtyler commented Jan 31, 2025

Tested releasing with https://github.com/pwtyler/autotag-sandbox/blob/main/.github/workflows/autotag.yml and successful action steps can be found there.

@pwtyler pwtyler marked this pull request as ready for review January 31, 2025 21:08
@pwtyler pwtyler requested a review from a team as a code owner January 31, 2025 21:08
@pwtyler pwtyler requested a review from jazzsequence January 31, 2025 21:17
@pwtyler pwtyler marked this pull request as draft January 31, 2025 21:21
@pwtyler
Copy link
Member Author

pwtyler commented Jan 31, 2025

Realized I still need to update docs...

@jazzsequence
Copy link
Contributor

Moves behavior into action.yml, removing shell script

Okay, but why? Literally 6 months ago you were telling me we should put shell code into shell scripts rather than GH actions. I'm not opposed but not sure it's necessary? (And if we can shellcheck the shell code, and run parameterized functions in a single .sh I would prefer that over not being able to lint the shell code.

action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Show resolved Hide resolved
@pwtyler
Copy link
Member Author

pwtyler commented Feb 1, 2025

Okay, but why? Literally 6 months ago you were telling me we should put shell code into shell scripts rather than GH actions. I'm not opposed but not sure it's necessary?

So Greg and I discussed this a bit last week because I was torn as well— the primary reason was because I was adding the conditionals to each step, and if I wanted all of that in a shell script, I'd be exporting values like ${{ inputs.push-tag == 'true' }} to variables or args to the shell script.

That said, as this action.yml file has come together, I could move anything > 3 lines or so into small shell scripts (e.g. the tag step and the push step each their own script).

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.

2 participants