Using a variable as the GitHub action version #108543
-
Select Topic AreaQuestion BodySuppose you want to check in a PR or a push the GitHub action in the version that's in the actual branch. You can use
But you would have to change the branch name every time you do that; if you want to test github actions, that gets tired after a while. You can't use mygithub/action@${{github.head_ref || github.ref_name }} That, however, fails with
So, long story short, is there an unambiguous way to version the github action to always refer to the branch it's in, or otherwise make a github action use the repo itself, in the current branch? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Have you tried |
Beta Was this translation helpful? Give feedback.
-
I cam here to ask this. In my case, I can't use the repo itself. I need to refer to an existing action:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Oh, yes, that's right, I believe you would need to use
actions/checkout
first. Additionally, if your action needs to be built (like a TypeScript action), you would have to make sure you've committed the latest build to match your source code.