action-gh-release
action-gh-release copied to clipboard
Can't seem to meet tag requirement
I'm using a local copy of your action for reasons, however, I can't seem to get the script to be happy with a tag that I'm setting.
The Workflow fires on:push and on:pull_request. I want to create a tag during the workflow sequence based on some environment variables. I can't seem to set the tag (git tag ${GITHUB_TAG}
) in a proper location within the workflow so that your script can pick it up.
I see that some commands require a push of the tag, but that would likely result in an infinite loop of workflow runs, which would be bad.
I hope you can point me at the obvious thing that I'm not seeing.
@miketrethewey thanks for reaching out.
Can you link to a repo where I can see and possibly try to reproduce your example?
I typically don't create a tag inside a workflow run but I think that should be possible. I can add some examples to the readme file. The logic that creates a tag on a push would need to be conditional in someway, I think you hinted at an env variable, in order to not create a loop but I don't think it's common to create a tag on every push.
That doesn't sound that the kind of problem that would be specific to this action. A push trigger that generates a push trigger that generates a push trigger sounds like a more general problem :) perhaps the workflow action that pushes a tag could only tag on pushes the specific branches when the current push ref is not a tag itself.
If you could link me to an example I can provide some more concrete help.
actions-test
branch of Artheau/SpriteSomething
Few things I noticed on initial glance.
- I don't think env variables get passed to between workflow actions steps by default. This may break some assumings the following code assumes
https://github.com/Artheau/SpriteSomething/blob/d514706adacc2ddebaa2c4e3c44a11a0791c930c/.github/workflows/ci.yml#L208
I haven't tied this myself yet but I'll do some experimenting. There does seem to be a special syntax for doing this mentioned in the docs
-
git tag only creates a tag on the runner. You need to push it to your git remote for GitHub releases to resolve it. https://github.com/Artheau/SpriteSomething/blob/d514706adacc2ddebaa2c4e3c44a11a0791c930c/.github/workflows/ci.yml#L211 I'll try an put together an example in this action's readme showing how to do that
-
there can be only one body. https://github.com/Artheau/SpriteSomething/blob/d514706adacc2ddebaa2c4e3c44a11a0791c930c/.github/workflows/ci.yml#L225 uses both options but only one will be used. This is mentioned here
I can take a closer look this weekend
-
Yeah. I’ve been attempting to just write and read them from disk, or do the same action twice, which is obviously redundant.
-
I think I’m being tripped up by whatever “push” means as an event that the system checks for. What I really want is for it to fire on “commit” and “pull request.”
-
Yep. I’m hoping that it’ll
cat
the contents ofRELEASENOTES.md
and if that fails, it’ll just provide a hyperlink to it instead.
Thanks for the insight! That’ll give me a direction when I too return home from work today.