Is there a way to access the current tag that has been pushed in a Github Action? In CircleCI you can access this value with the $CIRCLE_TAG
variable.
My Wor
Here's a workflow run showing that the GITHUB_REF
environment variable contains refs/tags/v0.0.2
:
I ran that by creating the tag, then doing git push origin v0.0.2
.
Here's a snippet of the workflow you see in that log:
steps:
- uses: actions/checkout@v1
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
if: runner.os != 'Windows'
- name: Show GitHub ref
run: echo "$GITHUB_REF"
if: runner.os != 'Windows'
- name: Dump event JSON
env:
EVENT_JSON_FILENAME: ${{ github.event_path }}
run: cat "$EVENT_JSON_FILENAME"
if: runner.os != 'Windows'
Since the log has been deleted, here's a screenshot for evidence: