1
0
Fork 0
mirror of https://github.com/carhartl/talisman-secrets-scan-action.git synced 2025-04-13 03:14:39 +00:00

Compare commits

...

16 commits
v1.2.0 ... main

Author SHA1 Message Date
Klaus Hartl
263098b1a2
Test for release script dependency 2023-02-19 12:50:56 +01:00
Klaus Hartl
b4df355506
Automate creating GitHub release
Creating a release draft, so that I can manually add release notes.
2023-02-19 12:46:50 +01:00
Klaus Hartl
94f83dd582
Ensure commits/tags are signed 2023-02-18 16:27:44 +01:00
Klaus Hartl
563f193bef
Change message to be less misleading 2023-02-18 16:16:30 +01:00
Klaus Hartl
f82ff5669a
Add release automation script 2023-02-18 16:13:52 +01:00
Klaus Hartl
12bec60c51
Add lefthook based git hooks setup 2023-02-18 10:09:18 +01:00
Klaus Hartl
85f9ff954a
Apply prettier fixes 2023-02-18 10:08:35 +01:00
Klaus Hartl
702fc5c521
Update readme for v1.4.0 2023-02-17 12:08:28 +01:00
Klaus Hartl
d56726748f
Bump talisman from 1.28.1 to 1.30.0
Closes 
2023-02-17 11:59:47 +01:00
Klaus Hartl
12d841b00c
Update checksum for readme 2022-08-15 14:13:22 +02:00
Klaus Hartl
6248162278
Update readme for v1.3.0 2022-08-15 14:07:41 +02:00
Klaus Hartl
a94edcf206
Bump talisman from 1.26.0 to 1.28.1 2022-08-15 14:05:25 +02:00
Klaus Hartl
914217b877
Update readme for v1.2.1 2022-04-14 06:55:56 +02:00
Klaus Hartl
4c9d9387c9
Add safe directory git config 2022-04-13 17:47:21 +02:00
Klaus Hartl
efb785d972
Remove trailing whitespace 2022-04-13 14:59:16 +02:00
Klaus Hartl
fb8e2e061a
Ensure to use up-to-date git 2022-04-13 14:50:12 +02:00
6 changed files with 70 additions and 5 deletions

View file

@ -1,3 +1,3 @@
fileignoreconfig:
- filename: README.md
checksum: c3f98d2e445a0fdfe9348f79c794aa4269edfea7f2c834d0b64f7bd88f9bd105
- filename: README.md
checksum: 6645dc4ac99294dd313e0c696499112aa0efc455627d7b9982e791559d727ada

View file

@ -1,8 +1,12 @@
FROM ubuntu:20.04
RUN apt update && apt install -y git
ENV DEBIAN_FRONTEND=noninteractive
ADD ["https://github.com/thoughtworks/talisman/releases/download/v1.26.0/talisman_linux_amd64", "/talisman"]
RUN apt update && apt install software-properties-common -y \
&& add-apt-repository ppa:git-core/ppa -y \
&& apt install -y git
ADD ["https://github.com/thoughtworks/talisman/releases/download/v1.30.0/talisman_linux_amd64", "/talisman"]
RUN chmod +x /talisman
COPY entrypoint.sh /entrypoint.sh

View file

@ -7,7 +7,7 @@ This action uses [Talisman](https://thoughtworks.github.io/talisman/) to scan th
```yml
steps:
- name: Detect secrets with Talisman in incoming commits
uses: carhartl/talisman-secrets-scan-action@v1.2.0
uses: carhartl/talisman-secrets-scan-action@v1.4.0
```
## Caveat

View file

@ -2,4 +2,5 @@
set -e
sh -c "git config --global --add safe.directory $PWD"
sh -c "echo $* | /talisman --githook pre-push"

8
lefthook.yml Normal file
View file

@ -0,0 +1,8 @@
pre-commit:
parallel: true
commands:
shellcheck:
glob: "*.sh"
run: shellcheck {staged_files}
prettier:
run: prettier --check .

52
run.sh Executable file
View file

@ -0,0 +1,52 @@
#!/bin/sh
set -eu
_user() {
printf "\033[0;33m%s\033[0m" "$1"
}
_fail() {
printf "\033[0;31m==> %s\033[0m\n\n" "$1"
}
prep_release() {
if ! git diff-index --quiet HEAD --; then
_fail "Repo must not be dirty"
exit 1
fi
grep -rlZE 'v\d+\.\d+\.\d+' --exclude=Dockerfile --exclude-dir=.git . | xargs sed -i '' 's/v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/'"$1"'/g'
_user "Prepare release draft on GitHub? "
read -r answer
if [ "$answer" = "y" ]; then
if ! command -v gh > /dev/null 2>&1; then
_fail "Script requires GitHub CLI: \`brew install gh\`"
exit 1
fi
git add --update
git commit -S -m "Prepare for $1 release"
git push origin main
git tag -s "$1" -m "Release $1"
git push --tags
gh release create --draft --latest --title "$1" --verify-tag
gh release view "$1" --web
fi
}
_help() {
echo "Usage: ./run.sh [command]"
echo ""
echo "Available commands:"
echo "prep-release <version> Prepare new release draft"
}
cmd="${1:-}"
case "$cmd" in
"prep-release")
shift
prep_release "$@"
;;
*) _help ;;
esac