mirror of
https://github.com/carhartl/talisman-secrets-scan-action.git
synced 2025-04-13 03:14:39 +00:00
Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
|
263098b1a2 | ||
|
b4df355506 | ||
|
94f83dd582 | ||
|
563f193bef | ||
|
f82ff5669a | ||
|
12bec60c51 | ||
|
85f9ff954a |
3 changed files with 63 additions and 3 deletions
|
@ -2,9 +2,9 @@ FROM ubuntu:20.04
|
|||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt update && apt install software-properties-common -y && \
|
||||
add-apt-repository ppa:git-core/ppa -y && \
|
||||
apt install -y git
|
||||
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
|
||||
|
|
8
lefthook.yml
Normal file
8
lefthook.yml
Normal 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
52
run.sh
Executable 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
|
Loading…
Add table
Reference in a new issue