Files
Charon/scripts/history-rewrite/check_refs.sh
GitHub Actions 8294d6ee49 Add QA test outputs, build scripts, and Dockerfile validation
- Created `qa-test-output-after-fix.txt` and `qa-test-output.txt` to log results of certificate page authentication tests.
- Added `build.sh` for deterministic backend builds in CI, utilizing `go list` for efficiency.
- Introduced `codeql_scan.sh` for CodeQL database creation and analysis for Go and JavaScript/TypeScript.
- Implemented `dockerfile_check.sh` to validate Dockerfiles for base image and package manager mismatches.
- Added `sourcery_precommit_wrapper.sh` to facilitate Sourcery CLI usage in pre-commit hooks.
2025-12-11 18:26:24 +00:00

43 lines
951 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
usage() {
cat <<EOF
Usage: $0
Lists branches and tags, saves a tag reference tarball to data/backups.
EOF
}
if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
usage; exit 0
fi
logdir="data/backups"
mkdir -p "$logdir"
ts=$(date +"%Y%m%d-%H%M%S")
tags_tar="$logdir/tags-$ts.tar.gz"
echo "Branches:"
git branch -a || true
echo "Tags:"
git tag -l || true
tmpdir=$(mktemp -d)
git show-ref --tags > "$tmpdir/tags-show-ref.txt" || true
tar -C "$tmpdir" -czf "$tags_tar" . || { echo "Warning: failed to create tag tarball" >&2; rm -rf "$tmpdir"; exit 1; }
rm -rf "$tmpdir"
echo "Created tags tarball: $tags_tar"
echo "Attempting to push tags to origin under refs/backups/tags/*"
for t in $(git tag --list); do
if ! git push origin "refs/tags/$t:refs/backups/tags/$t" >/dev/null 2>&1; then
echo "Warning: pushing tag $t to refs/backups/tags/$t failed" >&2
fi
done
echo "Done."
exit 0