Describe the bug
I have a release pipeline that needs to take the version from the branch name, following the pattern release/*, ie release/4.8.4.
As per the documentation, the branch name can be taken from the environment variable GITHUB_REF.
To overcome the lack of substring limitation in GitHub actions I have created a JavaScript action that takes some inputs and returns a slice of the string, for example from release/4.8.4 will return 4.8.4.
The issue comes when passing the $GITHUB_REF to the action:
- name: Release nameid: release_nameuses: web3j/slice-action@v1.3with:
value: $GITHUB_REFstart: 8# Remove 'release/' prefix
The return value in the expression ${{ steps.release_name.outputs.result }} would be expected to contain 4.8.4.
Instead it contains REF as you can verify in this build. That means that the GITHUB_REF env. variable has not been parsed but taken as a string instead.
I have tried passing the input as $GITHUB_REF, ${ GITHUB_REF } and ${{ GITHUB_REF }} and none of them works.
This is blocking a fix release so if there is an alternative way please share it. Thank you.
To Reproduce
Try to extract a version from the branch name. If you find a way to do it, please close this issue but for now this is a major limitation.
Expected behavior
The environment variable GITHUB_REF should be suitable for use as an action input.
Desktop (please complete the following information):
- OS: iOS 11.1
- Browser Chrome
- Version 87
Describe the bug
I have a release pipeline that needs to take the version from the branch name, following the pattern
release/*, ierelease/4.8.4.As per the documentation, the branch name can be taken from the environment variable
GITHUB_REF.To overcome the lack of substring limitation in GitHub actions I have created a JavaScript action that takes some inputs and returns a slice of the string, for example from
release/4.8.4will return4.8.4.The issue comes when passing the
$GITHUB_REFto the action:The return value in the expression
${{ steps.release_name.outputs.result }}would be expected to contain4.8.4.Instead it contains
REFas you can verify in this build. That means that theGITHUB_REFenv. variable has not been parsed but taken as a string instead.I have tried passing the input as
$GITHUB_REF,${ GITHUB_REF }and${{ GITHUB_REF }}and none of them works.This is blocking a fix release so if there is an alternative way please share it. Thank you.
To Reproduce
Try to extract a version from the branch name. If you find a way to do it, please close this issue but for now this is a major limitation.
Expected behavior
The environment variable
GITHUB_REFshould be suitable for use as an action input.Desktop (please complete the following information):