fixed mistakes in variables
This commit is contained in:
@@ -6,15 +6,15 @@ cd "${repo_root}"
|
|||||||
|
|
||||||
output_dir="${repo_root}/bootstrap"
|
output_dir="${repo_root}/bootstrap"
|
||||||
output_file="${output_dir}/badge.yaml"
|
output_file="${output_dir}/badge.yaml"
|
||||||
workflow_file="${repo_root}/.gitea/workflows/validate.yaml"
|
workflow_file="validate.yaml"
|
||||||
|
|
||||||
|
|
||||||
origin_url="$(git remote get-url origin | sed 's/git\@git\.olb42\.com\:/https:\/\/git.olb42.com\//' | sed 's/\.git$//' 2>/dev/null || true)"
|
origin_url="$(git remote get-url origin | sed 's/git\@git\.olb42\.com\:/https:\/\/git.olb42.com\//' | sed 's/\.git$//' 2>/dev/null || true)"
|
||||||
branch="$(git symbolic-ref --quiet --short HEAD 2>/dev/null || git rev-parse --short HEAD)"
|
branch="?branch=$(git symbolic-ref --quiet --short HEAD 2>/dev/null || git rev-parse --short HEAD)"
|
||||||
|
|
||||||
if [[ -f $workflow_file ]]; then
|
if [[ -f "${repo_root}/.gitea/workflows/${workflow_file}" ]]; then
|
||||||
mkdir -p "${output_dir}"
|
mkdir -p "${output_dir}"
|
||||||
printf "badge=%s/actions/workflows/%s/badge.svg%s\n" "${_origin_url}" "${_workflow_file:-validate.yaml}" "${_branch}" > $output_file
|
printf "badge=%s/actions/workflows/%s/badge.svg%s\n" "${origin_url}" "${workflow_file:-validate.yaml}" "${branch}" > $output_file
|
||||||
git add "${output_file}"
|
git add "${output_file}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user