diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index bcd3577..8d09208 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -17,12 +17,21 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.tag }} - - - name: 'get sha' + - name: Prepare + id: prep run: | - echo "SHORTREF=${GITHUB_SHA::8}" >> $GITHUB_ENV + DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/} + VERSION=latest + SHORTREF=$(git rev-parse --short=8 ${{ inputs.tag }}) + + VERSION=${{ inputs.tag }} + fi + TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}" + + # Set output parameters. + echo ::set-output name=tags::${TAGS} + echo ::set-output name=docker_image::${DOCKER_IMAGE} - echo "MYSHA=$(git rev-parse --short ${{ inputs.tag }})" >> $GITHUB_ENV - name: env run: env