Skip to content

Commit

Permalink
Merge pull request #7803 from camptocamp/test-mask
Browse files Browse the repository at this point in the history
Mask the secrets
  • Loading branch information
sbrunner authored Dec 10, 2021
2 parents cad9cd6 + 17ee691 commit 9dbe001
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: npm transifex
if: env.HAS_SECRETS == 'HAS_SECRETS'
- run: buildtools/addmask
if: env.HAS_SECRETS == 'HAS_SECRETS'
- run: gopass show gs/ci/test-mask

- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt
Expand Down
11 changes: 11 additions & 0 deletions buildtools/addmask
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -eu

gopass list --flat | grep -v /username$ | grep -v /url$ | grep -v /readme$ | grep -v /email$ | while read key; do
pass=$(gopass show ${key})
echo $key
for p in ${pass}; do
if [ ${#p} -gt 3 ]; then
echo "::add-mask::${p}"
fi
done
done

0 comments on commit 9dbe001

Please sign in to comment.