Skip to content

Commit

Permalink
Remove set-env due to CVE-2020-15228 (dapr#318)
Browse files Browse the repository at this point in the history
* Remove set-env due to CVE-2020-15228

* Remove set-env in file
  • Loading branch information
tcnghia authored Oct 16, 2020
1 parent 66a62c2 commit 798b003
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions .github/scripts/get_release_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,28 @@
# ------------------------------------------------------------

# This script parses release version from Git tag and set the parsed version to
# environment variable, REL_VERSION. If the tag is the final version, it sets
# LATEST_RELEASE to true to add 'latest' tag to docker image.
# environment variable, REL_VERSION.

import os
import sys

gitRef = os.getenv("GITHUB_REF")
tagRefPrefix = "refs/tags/v"

if gitRef is None or not gitRef.startswith(tagRefPrefix):
print ("##[set-env name=REL_VERSION;]edge")
print ("This is daily build from {}...".format(gitRef))
sys.exit(0)
with open(os.getenv("GITHUB_ENV"), "a") as githubEnv:
if gitRef is None or not gitRef.startswith(tagRefPrefix):
githubEnv.write("REL_VERSION=edge\n")
print ("This is daily build from {}...".format(gitRef))
sys.exit(0)

releaseVersion = gitRef[len(tagRefPrefix):]
releaseVersion = gitRef[len(tagRefPrefix):]
releaseNotePath="docs/release_notes/v{}.md".format(releaseVersion)

if gitRef.find("-rc.") > 0:
print ("Release Candidate build from {}...".format(gitRef))
else:
print ("##[set-env name=LATEST_RELEASE;]true")
print ("Release build from {}...".format(gitRef))
if gitRef.find("-rc.") > 0:
print ("Release Candidate build from {}...".format(gitRef))
else:
# Set LATEST_RELEASE to true
githubEnv.write("LATEST_RELEASE=true\n")
print ("Release build from {}...".format(gitRef))

print ("##[set-env name=REL_VERSION;]{}".format(releaseVersion))
githubEnv.write("REL_VERSION={}\n".format(releaseVersion))
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
if [ -z "${{ env.SAMPLE_REGISTRY }}" ]; then
export SAMPLE_REGISTRY=docker.io/dapriosamples
echo "##[set-env name=SAMPLE_REGISTRY;]$SAMPLE_REGISTRY"
echo "SAMPLE_REGISTRY=$SAMPLE_REGISTRY" >> $GITHUB_ENV
fi
SAMPLE_LIST=(hello-kubernetes distributed-calculator pub-sub bindings middleware observability secretstore)
Expand Down

0 comments on commit 798b003

Please sign in to comment.