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

proposal: Create Tag on Commit #76

Closed
cinderblock opened this issue Jan 7, 2020 · 8 comments · Fixed by #78
Closed

proposal: Create Tag on Commit #76

cinderblock opened this issue Jan 7, 2020 · 8 comments · Fixed by #78
Assignees
Labels

Comments

@cinderblock
Copy link

cinderblock commented Jan 7, 2020

Is your feature request related to a problem? Please describe.
I'd like to tag specific versions of my gh-pages branch programmatically (in my case, based on package.json version)

Describe the solution you'd like
I'd like an option to add a tag with a specified name on commit.

Describe alternatives you've considered
Manually - PITA.

Additional context
I'm thinking I'd like to be able to use this like so:

- name: Tagged Deploy
  env:
    ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
    PUBLISH_BRANCH: gh-pages
    PUBLISH_DIR: ./public
    CREATE_TAG: ${{ <expression> }}

Where expression might load some values from other steps or combine readily available job information.

Other options for forcing the overwrite of an existing tag or not might make sense too.

@peaceiris
Copy link
Owner

It sounds interesting. I will consider that option this weekend. (I'm busy now.)

@peaceiris peaceiris added the enhancement New feature or request label Jan 7, 2020
@peaceiris
Copy link
Owner

peaceiris commented Jan 7, 2020

My suggestion.

- name: Prepare deployment
  id: prepare_deployment
  run: |
    TAG_NAME="v$(jq -r '.version' ./package.json)"
    echo "::set-output name=tag_name::${TAG_NAME}"

- name: Tagged Deploy
  uses: peaceiris/actions-gh-pages@v2
  env:
    ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
    PUBLISH_BRANCH: gh-pages
    PUBLISH_DIR: ./public
  with:
    tagName: deploy-v${{ steps.prepare_deployment.outputs.tag_name }}

Other options for forcing the overwrite of an existing tag or not might make sense too.

Yes.

@cinderblock
Copy link
Author

Yes, that's a good example of how this might be used.

@cinderblock
Copy link
Author

Is there a reason you used env for most of the options but are suggesting with for this one?

@peaceiris
Copy link
Owner

The with statement can contain useful options like required and default. It is better to use with than env. This action has published when GitHub Actions was beta v1 and we had only env. I am going to move all env options under with. #54

emptyCommits:
description: 'If empty commits should be made to the publication branch'
required: false
default: 'true'

@cinderblock
Copy link
Author

cinderblock commented Jan 9, 2020

Ah. Historical reasons make sense.

FYI, they implemented with by just having an env with prefix INPUT_:

https://github.com/actions/toolkit/blob/03ebc5b8851571a1ce55409097a52b1a74019e52/packages/core/src/core.ts#L60-L75

@peaceiris
Copy link
Owner

Go to #78

peaceiris added a commit that referenced this issue Jan 18, 2020
* feat: Add tagName and tagMessage options
* feat: Add print_info for tag options
* feat: Add tagOverwrite option
* docs: Add new section about Git tag options

Close #76
@github-actions
Copy link
Contributor

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants