diff --git a/.github/workflows/variablesTest.yml b/.github/workflows/variablesTest.yml new file mode 100644 index 0000000..eea414f --- /dev/null +++ b/.github/workflows/variablesTest.yml @@ -0,0 +1,39 @@ +name: Test env variables +on: + workflow_dispatch: + pull_request: + push: + +env: + DOCKER_IMAGE_TAG: :refs_heads_${{ github.ref_name }}-bk0 + +jobs: + check_event: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Echo variables + run: | + echo ${{ env.DOCKER_IMAGE_TAG }} + echo ${{ github.event_name }} + echo ${{ github.HEAD_REF }} + + - name: Check for DOCKER_IMAGE_TAG change + if: github.event_name == 'pull_request' + run: echo "DOCKER_IMAGE_TAG=:refs_heads_${GITHUB_HEAD_REF}-bk0" >> $GITHUB_ENV + + + - name: Echo DOCKER_IMAGE_TAG again + run: echo ${{ env.DOCKER_IMAGE_TAG }} + + check_permanence: + needs: [check_event] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Echo DOCKER_IMAGE_TAG again + run: echo ${{ env.DOCKER_IMAGE_TAG }} \ No newline at end of file