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

Commit

Permalink
Merge pull request #849 from vdice/fix/ci-releasing-token-leak
Browse files Browse the repository at this point in the history
fix(brigade.js): prevent token leak if github-release fails
  • Loading branch information
vdice committed Sep 26, 2019
2 parents 2335847 + cfb0b5a commit 9e3ceab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions brigade.js
Expand Up @@ -97,6 +97,7 @@ function githubRelease(p, tag) {
"GITHUB_REPO": parts[1],
"GITHUB_TOKEN": p.secrets.ghToken,
};
job.shell = "/bin/bash";
job.tasks = [
"go get github.com/aktau/github-release",
`cd ${localPath}`,
Expand All @@ -105,9 +106,10 @@ function githubRelease(p, tag) {
`github-release release \
-t ${tag} \
-n "${parts[1]} ${tag}" \
-d "$(git log --no-merges --pretty=format:'- %s %H (%aN)' HEAD ^$last_tag)" \
|| echo "release ${tag} exists"`,
`for bin in ./bin/*; do github-release upload -f $bin -n $(basename $bin) -t ${tag}; done`
-d "$(git log --no-merges --pretty=format:'- %s %H (%aN)' HEAD ^$last_tag)" 2>&1 | sed -e "s/\${GITHUB_TOKEN}/<REDACTED>/"`,
`for bin in ./bin/*; do \
github-release upload -f $bin -n $(basename $bin) -t ${tag} 2>&1 | sed -e "s/\${GITHUB_TOKEN}/<REDACTED>/"; \
done`
];
console.log(job.tasks);
console.log(`releases at https://github.com/${p.repo.name}/releases/tag/${tag}`);
Expand Down

0 comments on commit 9e3ceab

Please sign in to comment.