Skip to content

chore(deps): update dependency developerc286/clean_git_history to v1 #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/git-history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Check clean Git history.
run: earthly --ci +check-clean-git-history --from_reference "origin/${{ github.base_ref }}"
run: earthly --ci +check-clean-git-history --from "origin/${{ github.base_ref }}"
8 changes: 4 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ alpine-base:
check-clean-git-history:
FROM +alpine-base
# renovate: datasource=github-releases depName=DeveloperC286/clean_git_history
ENV CLEAN_GIT_HISTORY_VERSION="v0.2.0"
RUN wget -O - "https://github.com/DeveloperC286/clean_git_history/releases/download/${CLEAN_GIT_HISTORY_VERSION}/x86_64-unknown-linux-musl.gz" | gzip -d > /usr/bin/clean_git_history && chmod 755 /usr/bin/clean_git_history
ENV CLEAN_GIT_HISTORY_VERSION="v1.0.0"
RUN wget -O - "https://github.com/DeveloperC286/clean_git_history/releases/download/${CLEAN_GIT_HISTORY_VERSION}/x86_64-unknown-linux-musl.tar.gz" | tar xz --directory "/usr/bin/"
DO +COPY_METADATA
ARG from_reference="origin/HEAD"
RUN ./ci/check-clean-git-history.sh --from-reference "${from_reference}"
ARG from="origin/HEAD"
RUN ./ci/check-clean-git-history.sh "${from_reference}"


check-conventional-commits-linting:
Expand Down
64 changes: 7 additions & 57 deletions ci/check-clean-git-history.sh
Original file line number Diff line number Diff line change
@@ -1,61 +1,11 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

# ARG_OPTIONAL_SINGLE([from-reference],[],[],[origin/HEAD])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.9.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, see https://argbash.io for more info
# Generated online by https://argbash.io/generate

die() {
local _ret="${2:-1}"
test "${_PRINT_HELP:-no}" = yes && print_help >&2
echo "$1" >&2
exit "${_ret}"
}

begins_with_short_option() {
local first_option all_short_options=''
first_option="${1:0:1}"
test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0
}

# THE DEFAULTS INITIALIZATION - OPTIONALS
_arg_from_reference="origin/HEAD"

print_help() {
printf 'Usage: %s [--from-reference <arg>]\n' "$0"
}

parse_commandline() {
while test $# -gt 0; do
_key="$1"
case "$_key" in
--from-reference)
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
_arg_from_reference="$2"
shift
;;
--from-reference=*)
_arg_from_reference="${_key##--from-reference=}"
;;
*)
_PRINT_HELP=yes die "FATAL ERROR: Got an unexpected argument '$1'" 1
;;
esac
shift
done
}

parse_commandline "$@"

# OTHER STUFF GENERATED BY Argbash

### END OF CODE GENERATED BY Argbash (sortof) ### ])
# [ <-- needed because of Argbash
set -o errexit
set -o xtrace

clean_git_history --from-reference "${_arg_from_reference}"
# ] <-- needed because of Argbash
if [ $# -ne 1 ]; then
echo "Usage: $0 <from>"
exit 1
fi

clean_git_history "$1"