Skip to content

Instantly share code, notes, and snippets.

@jokester
Last active November 22, 2020 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jokester/8473868f69cc3d3d4029e7b3beec5bd5 to your computer and use it in GitHub Desktop.
Save jokester/8473868f69cc3d3d4029e7b3beec5bd5 to your computer and use it in GitHub Desktop.
Tricks for github action workflows
# poc of string interpolation in bash / github action
- name: print env variables to job output
run: for v in `cat env` ; do echo "::set-env name=${v%%=*}::${v##*=}" ; done
- name: use (maybe ) in shell command
run: docker push myrepo/myapp:${TAG_REF#refs/tags/}
env:
TAG_REF: ${{ github.ref }}
# references:
# - shell string interpolation https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
# - action workflow syntax: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# - action expression/function syntax: https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment