try again #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test stuff | |
on: | |
- push | |
- pull_request | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Dump env | |
run: env | sort | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: show tag name | |
run: echo "TAG_NAME ${{ github.event.release.tag_name }}" | |
- name: get latest tag | |
run: | | |
git fetch --tags | |
export LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | |
echo "LATEST TAG: ${LATEST_TAG}" | |
export GIT_BRANCH=${GITHUB_REF#refs/heads/} | |
echo "GIT BRANCH: ${GIT_BRANCH}" | |
export GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") | |
echo "GIT HASH: ${GIT_HASH}" | |
export TAG_NAME=${{ github.event.release.tag_name }} | |
echo "DEFAULT: ${TAG_NAME:-${LATEST_TAG}dev${GIT_BRANCH}${GIT_HASH}}" |