Skip to content

Instantly share code, notes, and snippets.

@atrakic
Created December 26, 2024 21:48
Show Gist options
  • Save atrakic/f527d20a3827441801ba67dd3b786df7 to your computer and use it in GitHub Desktop.
Save atrakic/f527d20a3827441801ba67dd3b786df7 to your computer and use it in GitHub Desktop.
git devops tools
git push origin --delete $1
git commit -m "wip: $(curl -s https://whatthecommit.com/index.txt)"
docker run -it --rm -e \
CHANGELOG_GITHUB_TOKEN="$GH_TOKEN" \
-v "$(pwd)":/usr/local/src/app \
githubchangeloggenerator/github-changelog-generator \
-u "$GH_ORG" -p "$REPO"
repo="$1"
prefix="https:\/\/github.com\/"
suffix=".git"
stripped=$(echo "$repo"|sed -e "s/^$prefix//" -e "s/$suffix$//")
git clone "$repo" "$stripped"
#!/usr/bin/env bash
set -euo pipefail
REPO="${REPO:-$(basename "$PWD")}"
GH_ORG="${GH_ORG:-Cloud8}"
main() {
VERSION="$1"
if [ -z "$VERSION" ]; then echo "Error no version provided"; exit; fi
echo "You are about to create gh-release $VERSION"
echo "Are you sure? (Press Enter to continue or Ctrl+C to abort) "
read -r _
if [ -n "$GH_TOKEN" ] && [ "$(git rev-parse --is-inside-work-tree)" ]; then
git status --porcelain --untracked-files=no || { echo "Error: git repo not clean"; exit 1;}
default=$( basename "$(git symbolic-ref --short refs/remotes/origin/HEAD)" )
git checkout "$default"
git pull
# gpg --default-new-key-algo rsa4096 --gen-key
# https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-tags
git tag "${VERSION}" -m "chore: $VERSION"
git push origin "${VERSION}" -f
curl \
-H "Authorization: token $GH_TOKEN" \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/"$GH_ORG"/"$REPO"/releases \
-d "{\"tag_name\":\"$VERSION\",\"generate_release_notes\": true}"
else
echo "Error, no GH_TOKEN provided"
fi
}
main "$*"
#!/bin/bash
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")
for i in $(ls -d */); do
pushd "$i";
git stash && git pull;
git log -1 HEAD | cat -;
popd;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment