From 213960abc3ee57275c8542439e0d12a56408383d Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Sun, 1 Oct 2023 21:10:17 +0200 Subject: [PATCH] fix: normal git commit checkout --- .markdownlint.yaml | 144 ++++++++++++++++++++++++++++++ README.md | 2 +- rootfs/usr/local/bin/clone-commit | 4 +- 3 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 .markdownlint.yaml diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..58b704a --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,144 @@ +# markdownlint YAML configuration +# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml + +# Default state for all rules +default: true + +# Path to configuration file to extend +extends: null + +# MD003/heading-style/header-style - Heading style +MD003: + # Heading style + style: "atx" + +# MD004/ul-style - Unordered list style +MD004: + style: "dash" + +# MD007/ul-indent - Unordered list indentation +MD007: + # Spaces for indent + indent: 2 + # Whether to indent the first level of the list + start_indented: false + +# MD009/no-trailing-spaces - Trailing spaces +MD009: + # Spaces for line break + br_spaces: 2 + # Allow spaces for empty lines in list items + list_item_empty_lines: false + # Include unnecessary breaks + strict: false + +# MD010/no-hard-tabs - Hard tabs +MD010: + # Include code blocks + code_blocks: true + +# MD012/no-multiple-blanks - Multiple consecutive blank lines +MD012: + # Consecutive blank lines + maximum: 1 + +# MD013/line-length - Line length +MD013: + # Number of characters + line_length: 80 + # Number of characters for headings + heading_line_length: 80 + # Number of characters for code blocks + code_block_line_length: 80 + # Include code blocks + code_blocks: false + # Include tables + tables: false + # Include headings + headings: true + # Include headings + headers: true + # Strict length checking + strict: false + # Stern length checking + stern: false + +# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines +MD022: + # Blank lines above heading + lines_above: 1 + # Blank lines below heading + lines_below: 1 + +# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content +MD024: + # Only check sibling headings + allow_different_nesting: true + +# MD025/single-title/single-h1 - Multiple top-level headings in the same document +MD025: + # Heading level + level: 1 + # RegExp for matching title in front matter + front_matter_title: "^\\s*title\\s*[:=]" + +# MD026/no-trailing-punctuation - Trailing punctuation in heading +MD026: + # Punctuation characters + punctuation: ".,;:!。,;:!" + +# MD029/ol-prefix - Ordered list item prefix +MD029: + # List style + style: "one_or_ordered" + +# MD030/list-marker-space - Spaces after list markers +MD030: + # Spaces for single-line unordered list items + ul_single: 1 + # Spaces for single-line ordered list items + ol_single: 1 + # Spaces for multi-line unordered list items + ul_multi: 1 + # Spaces for multi-line ordered list items + ol_multi: 1 + +# MD033/no-inline-html - Inline HTML +MD033: + # Allowed elements + allowed_elements: [] + +# MD035/hr-style - Horizontal rule style +MD035: + # Horizontal rule style + style: "---" + +# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading +MD036: + # Punctuation characters + punctuation: ".,;:!?。,;:!?" + +# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading +MD041: + # Heading level + level: 1 + # RegExp for matching title in front matter + front_matter_title: "^\\s*title\\s*[:=]" + +# MD044/proper-names - Proper names should have the correct capitalization +MD044: + # List of proper names + names: + - helm + # Include code blocks + code_blocks: false + +# MD046/code-block-style - Code block style +MD046: + # Block style + style: "fenced" + +# MD048/code-fence-style - Code fence style +MD048: + # Code fence syle + style: "backtick" \ No newline at end of file diff --git a/README.md b/README.md index 435e626..bc874c0 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Clone a commit: podman run \ --rm \ --env DRONE_BUILD_EVENT=push \ - --env DRONE_COMMIT_SHA=39d233b3d9eccc68e66508a06a725a2567f33143 \ + --env DRONE_COMMIT_BRANCH=master \ --env DRONE_REMOTE_URL=https://git.cryptic.systems/volker.raschek/git-docker.git \ --env DRONE_WORKSPACE=/workspace \ --volume /tmp/workspace:/workspace \ diff --git a/rootfs/usr/local/bin/clone-commit b/rootfs/usr/local/bin/clone-commit index 7a0f924..4639d76 100755 --- a/rootfs/usr/local/bin/clone-commit +++ b/rootfs/usr/local/bin/clone-commit @@ -37,9 +37,11 @@ fi # fast-forward is not possible. Checkout the specified commit sha which must be # part of the branch. if [[ -n "${DRONE_COMMIT_BRANCH}" ]] && [[ -n "${DRONE_COMMIT_SHA}" ]]; then - GIT_CHECKOUT_ARGS="${GIT_CHECKOUT_ARGS} -b ${DRONE_COMMIT_SHA} -b refs/remotes/origin/${DRONE_COMMIT_BRANCH}" + GIT_CHECKOUT_ARGS="${GIT_CHECKOUT_ARGS} ${DRONE_COMMIT_SHA} -b refs/remotes/origin/${DRONE_COMMIT_BRANCH}" GIT_FETCH_ARGS="${GIT_FETCH_ARGS} origin +refs/heads/${DRONE_COMMIT_BRANCH}:refs/remotes/origin/${DRONE_COMMIT_BRANCH}" fi git fetch ${GIT_FETCH_ARGS} git checkout ${GIT_CHECKOUT_ARGS} + +ls -la