name: Post Tag

on:
  push:
    tags:
      - '*'

jobs:
  build:
    name: Push Latest Release
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v2

      - name: Set TAG_NAME in Environment
        # Subsequent jobs will be have the computed tag name
        run: echo ::set-env name=TAG_NAME::"${GITHUB_REF##*/}"

      - name: Test
        run: make ci-release-test
        timeout-minutes: 60

      - name: Build Release Binaries
        env:
          TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}
        run: make release

      - name: Build and Deploy OPA Docker Images
        id: build-and-deploy
        env:
          DOCKER_USER: ${{ secrets.DOCKER_USER }}
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
          DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
        # Only run if required secrets are provided
        if: ${{ env.DOCKER_USER && env.DOCKER_PASSWORD }}
        run: make release-ci

      - name: Create or Update Release
        env:
          # Required for the `hub` CLI
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: ./build/github-release.sh --asset-dir=./_release/${TAG_NAME#v}/ --tag=${TAG_NAME}

name: Post Tag

on:
  push:
    tags:
      - '*'

jobs:
  build:
    name: Push Latest Release
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v2

      - name: Set TAG_NAME in Environment
        # Subsequent jobs will be have the computed tag name
        run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV

      - name: Test
        run: make ci-release-test
        timeout-minutes: 60

      - name: Build Release Binaries
        env:
          TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}
        run: make release

      - name: Build and Deploy OPA Docker Images
        id: build-and-deploy
        env:
          DOCKER_USER: ${{ secrets.DOCKER_USER }}
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
          DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
        # Only run if required secrets are provided
        if: ${{ env.DOCKER_USER && env.DOCKER_PASSWORD }}
        run: make release-ci

      - name: Create or Update Release
        env:
          # Required for the `hub` CLI
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: ./build/github-release.sh --asset-dir=./_release/${TAG_NAME#v}/ --tag=${TAG_NAME}

Update post tag workflow to use env files
.github: Update post tag workflow to use env files

The post tag workflow used the set-env command to
set the TAG_NAME env variable. The set-env command is
now disabled due to a security vulnerability in the GitHub Actions
runner that can allow environment variable and path injection in
workflows that log untrusted data to STDOUT. For more information see:
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

This change updates the workflow to remove
usage of the set-env command to use environment files
instead.

Signed-off-by: Ashutosh Narkar <334e9094b46d3151817f829cebfa78d0453b0333@gmail.com>
