Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
new way of setting env variables in GH Actions (#4700)
Browse files Browse the repository at this point in the history
Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>
  • Loading branch information
epwalsh and dirkgr authored Oct 7, 2020
1 parent c14ea40 commit 001e1f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- name: Set Docker tag
run: |
if [[ $GITHUB_EVENT_NAME == 'release' ]]; then
echo "::set-env name=DOCKER_TAG::${GITHUB_REF#refs/tags/}";
echo "DOCKER_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV;
else
echo "::set-env name=DOCKER_TAG::$GITHUB_SHA";
echo "DOCKER_TAG=$GITHUB_SHA" >> $GITHUB_ENV;
fi
- name: Build test image
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
# This is somewhat bizarre, but you can't set env variables to bash
# commands in the action workflow - so we have to use this odd way of
# exporting a variable instead.
echo ::set-env name=ALLENNLP_VERSION_SUFFIX::.dev$(date -u +%Y%m%d)
echo "ALLENNLP_VERSION_SUFFIX=dev$(date -u +%Y%m%d)" >> $GITHUB_ENV
- name: Check version and release tag match
if: github.event_name == 'release'
Expand Down Expand Up @@ -270,9 +270,9 @@ jobs:
- name: Set Docker image name
run: |
if [[ $GITHUB_EVENT_NAME == 'release' ]]; then
echo "::set-env name=DOCKER_IMAGE_NAME::allennlp/allennlp:${GITHUB_REF#refs/tags/}";
echo "DOCKER_IMAGE_NAME=allennlp/allennlp:${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV;
else
echo "::set-env name=DOCKER_IMAGE_NAME::allennlp/commit:$GITHUB_SHA";
echo "DOCKER_IMAGE_NAME=allennlp/commit:$GITHUB_SHA" >> $GITHUB_ENV;
fi
- name: Download core package
Expand Down Expand Up @@ -360,9 +360,9 @@ jobs:
- name: Set target folders
run: |
if [[ $GITHUB_EVENT_NAME == 'release' ]]; then
echo "::set-env name=DOCS_FOLDER::${GITHUB_REF#refs/tags/}";
echo "DOCS_FOLDER=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV;
else
echo "::set-env name=DOCS_FOLDER::master";
echo "DOCS_FOLDER=master" >> $GITHUB_ENV;
fi
- name: Stage docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Set Docker tag
run: |
echo "::set-env name=DOCKER_TAG::$GITHUB_SHA";
echo "DOCKER_TAG=$GITHUB_SHA" >> $GITHUB_ENV
- name: Build test image
run: |
Expand Down

0 comments on commit 001e1f7

Please sign in to comment.