I have a github action that runs set-env, now as it is deprecated as mentioned here, how can refactor the following code?
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF} | tr -cd '[:alnum:]\n' | cut -c -30 | tr '[:upper:]' '[:lower:]')"
According to the documentation:
Additionally, instead of messing up with
trandcutyou can get the branch name in a more convenient way using theGITHUB_REFbuilt-in variable. It will simplify the script to