├── .changelog.yml ├── .editorconfig ├── .gitignore ├── .golangci.yml ├── .hadolint.yml ├── .markdownlint.yaml ├── .pre-commit-config.yaml ├── .prettierrc ├── .woodpecker ├── release.yml └── test-release.yml ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── defaults.go ├── docker └── Dockerfile.multiarch ├── docs.md ├── flags.go ├── git.svg ├── go.mod ├── go.sum ├── main.go ├── plugin.go ├── plugin_test.go ├── renovate.json ├── types.go ├── umask.go ├── umask_win.go └── utils.go /.changelog.yml: -------------------------------------------------------------------------------- 1 | # config for https://gitea.com/gitea/changelog to generate CHANGELOG.md 2 | 3 | # The full repository name 4 | repo: woodpecker-ci/plugin-git 5 | 6 | # Service type (gitea or github) 7 | service: github 8 | 9 | # Changelog groups and which labeled PRs to add to each group 10 | groups: 11 | - 12 | name: BREAKING 13 | labels: 14 | - breaking 15 | - 16 | name: FEATURES 17 | labels: 18 | - feature 19 | - 20 | name: SECURITY 21 | labels: 22 | - security 23 | - 24 | name: BUGFIXES 25 | labels: 26 | - bug 27 | - 28 | name: ENHANCEMENTS 29 | labels: 30 | - enhancement 31 | - refactor 32 | - ui 33 | - 34 | name: TESTING 35 | labels: 36 | - tests 37 | - 38 | name: TRANSLATION 39 | labels: 40 | - kind/translation 41 | - 42 | name: BUILD 43 | labels: 44 | - kind/build 45 | - kind/lint 46 | - 47 | name: DOCUMENTATION 48 | labels: 49 | - documentation 50 | - 51 | name: MISC 52 | default: true 53 | 54 | # regex indicating which labels to skip for the changelog 55 | skip-labels: skip-changelog|backport 56 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | tab_width = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.go] 13 | indent_style = tab 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | 18 | [Makefile] 19 | indent_style = tab 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | 26 | release/ 27 | vendor/ 28 | 29 | coverage.out 30 | plugin-git 31 | 32 | .vscode 33 | .idea 34 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | linters-settings: 2 | gofmt: 3 | simplify: true 4 | misspell: 5 | locale: US 6 | gofumpt: 7 | extra-rules: true 8 | forbidigo: 9 | forbid: 10 | - context\.WithCancel$ 11 | - ^print.*$ 12 | - panic 13 | errorlint: 14 | errorf-multi: true 15 | 16 | linters: 17 | disable-all: true 18 | enable: 19 | - bidichk 20 | - errcheck 21 | - gofmt 22 | - goimports 23 | - gosimple 24 | - govet 25 | - ineffassign 26 | - misspell 27 | - revive 28 | - staticcheck 29 | - typecheck 30 | - unused 31 | - whitespace 32 | - gofumpt 33 | - errorlint 34 | - forbidigo 35 | - zerologlint 36 | 37 | run: 38 | timeout: 5m 39 | -------------------------------------------------------------------------------- /.hadolint.yml: -------------------------------------------------------------------------------- 1 | ignored: 2 | - DL3018 # pin versions in Dockerfile 3 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # markdownlint YAML configuration 2 | # https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml 3 | 4 | # Default state for all rules 5 | default: true 6 | 7 | # Path to configuration file to extend 8 | extends: null 9 | 10 | # MD003/heading-style/header-style - Heading style 11 | MD003: 12 | # Heading style 13 | style: 'atx' 14 | 15 | # MD004/ul-style - Unordered list style 16 | MD004: 17 | style: 'dash' 18 | 19 | # MD007/ul-indent - Unordered list indentation 20 | MD007: 21 | # Spaces for indent 22 | indent: 2 23 | # Whether to indent the first level of the list 24 | start_indented: false 25 | 26 | # MD009/no-trailing-spaces - Trailing spaces 27 | MD009: 28 | # Spaces for line break 29 | br_spaces: 2 30 | # Allow spaces for empty lines in list items 31 | list_item_empty_lines: false 32 | # Include unnecessary breaks 33 | strict: false 34 | 35 | # MD010/no-hard-tabs - Hard tabs 36 | MD010: 37 | # Include code blocks 38 | code_blocks: true 39 | 40 | # MD012/no-multiple-blanks - Multiple consecutive blank lines 41 | MD012: 42 | # Consecutive blank lines 43 | maximum: 1 44 | 45 | # MD013/line-length - Line length 46 | MD013: 47 | # Number of characters 48 | line_length: 500 49 | # Number of characters for headings 50 | heading_line_length: 100 51 | # Number of characters for code blocks 52 | code_block_line_length: 80 53 | # Include code blocks 54 | code_blocks: false 55 | # Include tables 56 | tables: false 57 | # Include headings 58 | headings: true 59 | # Include headings 60 | headers: true 61 | # Strict length checking 62 | strict: false 63 | # Stern length checking 64 | stern: false 65 | 66 | # MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines 67 | MD022: 68 | # Blank lines above heading 69 | lines_above: 1 70 | # Blank lines below heading 71 | lines_below: 1 72 | 73 | # MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content 74 | MD024: 75 | # Only check sibling headings 76 | allow_different_nesting: true 77 | 78 | # MD025/single-title/single-h1 - Multiple top-level headings in the same document 79 | MD025: 80 | # Heading level 81 | level: 1 82 | # RegExp for matching title in front matter 83 | front_matter_title: "^\\s*title\\s*[:=]" 84 | 85 | # MD026/no-trailing-punctuation - Trailing punctuation in heading 86 | MD026: 87 | # Punctuation characters 88 | punctuation: '.,;:!。,;:!' 89 | 90 | # MD029/ol-prefix - Ordered list item prefix 91 | MD029: 92 | # List style 93 | style: 'one_or_ordered' 94 | 95 | # MD030/list-marker-space - Spaces after list markers 96 | MD030: 97 | # Spaces for single-line unordered list items 98 | ul_single: 1 99 | # Spaces for single-line ordered list items 100 | ol_single: 1 101 | # Spaces for multi-line unordered list items 102 | ul_multi: 1 103 | # Spaces for multi-line ordered list items 104 | ol_multi: 1 105 | 106 | # MD033/no-inline-html - Inline HTML 107 | MD033: 108 | # Allowed elements 109 | allowed_elements: [details, summary, img, a, br, p] 110 | 111 | # MD035/hr-style - Horizontal rule style 112 | MD035: 113 | # Horizontal rule style 114 | style: '---' 115 | 116 | # MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading 117 | MD036: 118 | # Punctuation characters 119 | punctuation: '.,;:!?。,;:!?' 120 | 121 | # MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading 122 | MD041: 123 | # Heading level 124 | level: 1 125 | # RegExp for matching title in front matter 126 | front_matter_title: "^\\s*title\\s*[:=]" 127 | 128 | # MD044/proper-names - Proper names should have the correct capitalization 129 | MD044: 130 | # List of proper names 131 | # names: 132 | # Include code blocks 133 | code_blocks: false 134 | 135 | # MD046/code-block-style - Code block style 136 | MD046: 137 | # Block style 138 | style: 'fenced' 139 | 140 | # MD048/code-fence-style - Code fence style 141 | MD048: 142 | # Code fence syle 143 | style: 'backtick' 144 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: meta 3 | hooks: 4 | - id: check-hooks-apply 5 | - id: check-useless-excludes 6 | - repo: https://github.com/pre-commit/pre-commit-hooks 7 | rev: v5.0.0 8 | hooks: 9 | - id: check-yaml 10 | - id: end-of-file-fixer 11 | - id: trailing-whitespace 12 | - repo: https://github.com/golangci/golangci-lint 13 | rev: v2.1.6 14 | hooks: 15 | - id: golangci-lint 16 | - repo: https://github.com/igorshubovych/markdownlint-cli 17 | rev: v0.45.0 18 | hooks: 19 | - id: markdownlint 20 | exclude: '^CHANGELOG.md$' 21 | language_version: 22.15.1 22 | - repo: https://github.com/mrtazz/checkmake 23 | rev: 0.2.2 24 | hooks: 25 | - id: checkmake 26 | - repo: https://github.com/hadolint/hadolint 27 | rev: v2.13.1-beta 28 | hooks: 29 | - id: hadolint 30 | 31 | ci: 32 | autofix_commit_msg: | 33 | [pre-commit.ci] auto fixes from pre-commit.com hooks [CI SKIP] 34 | 35 | for more information, see https://pre-commit.ci 36 | autofix_prs: true 37 | autoupdate_branch: '' 38 | autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' 39 | autoupdate_schedule: monthly 40 | # NB: hadolint not included in pre-commit.ci 41 | skip: [check-hooks-apply, check-useless-excludes, hadolint, golangci-lint] 42 | submodules: false 43 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "trailingComma": "all", 4 | "singleQuote": true, 5 | "printWidth": 120, 6 | "tabWidth": 2, 7 | "endOfLine": "lf" 8 | } 9 | -------------------------------------------------------------------------------- /.woodpecker/release.yml: -------------------------------------------------------------------------------- 1 | when: 2 | event: push 3 | branch: ${CI_REPO_DEFAULT_BRANCH} 4 | 5 | steps: 6 | release: 7 | image: woodpeckerci/plugin-ready-release-go:3.2.0 8 | pull: true 9 | settings: 10 | release_branch: ${CI_REPO_DEFAULT_BRANCH} 11 | forge_type: github 12 | git_email: woodpecker-bot@obermui.de 13 | github_token: 14 | from_secret: GITHUB_TOKEN 15 | -------------------------------------------------------------------------------- /.woodpecker/test-release.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - &golang 'golang:1.24-alpine' 3 | - &platforms 'linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/riscv64,linux/s390x' 4 | # vars used on push / tag events only 5 | - publish_logins: &publish_logins 6 | # Default DockerHub login 7 | - registry: https://index.docker.io/v1/ 8 | username: woodpeckerbot 9 | password: 10 | from_secret: docker_password 11 | # Additional Quay.IO login 12 | - registry: https://quay.io 13 | username: 'woodpeckerci+wp_ci' 14 | password: 15 | from_secret: QUAY_IO_TOKEN 16 | - &publish_repos 'woodpeckerci/plugin-git,quay.io/woodpeckerci/plugin-git' 17 | 18 | steps: 19 | vendor: 20 | image: *golang 21 | commands: 22 | - go mod vendor 23 | 24 | lint: 25 | image: *golang 26 | depends_on: vendor 27 | commands: 28 | - apk add make 29 | - make vet 30 | - make formatcheck 31 | when: 32 | - event: pull_request 33 | - event: push 34 | branch: renovate/* 35 | 36 | test: 37 | image: *golang 38 | depends_on: vendor 39 | commands: 40 | - apk add make git-lfs 41 | - make test 42 | when: 43 | - event: pull_request 44 | - event: push 45 | branch: renovate/* 46 | 47 | build-dryrun: 48 | image: woodpeckerci/plugin-docker-buildx:6.0.1 49 | depends_on: 50 | - lint 51 | - test 52 | settings: 53 | repo: test/repo 54 | dockerfile: ./docker/Dockerfile.multiarch 55 | dry_run: true 56 | platforms: *platforms 57 | tags: latest 58 | when: 59 | - event: pull_request 60 | - event: push 61 | branch: renovate/* 62 | 63 | release-next: 64 | image: woodpeckerci/plugin-docker-buildx:6.0.1 65 | depends_on: vendor 66 | settings: 67 | repo: *publish_repos 68 | dockerfile: ./docker/Dockerfile.multiarch 69 | platforms: *platforms 70 | tags: next 71 | logins: *publish_logins 72 | when: 73 | branch: ${CI_REPO_DEFAULT_BRANCH} 74 | event: push 75 | 76 | release-tag: 77 | image: woodpeckerci/plugin-docker-buildx:6.0.1 78 | depends_on: vendor 79 | settings: 80 | repo: *publish_repos 81 | dockerfile: ./docker/Dockerfile.multiarch 82 | platforms: *platforms 83 | auto_tag: true 84 | # remove line below if you can read it on a release branch and it's not the latest release branch 85 | tags: latest 86 | logins: *publish_logins 87 | when: 88 | event: tag 89 | 90 | build-binaries: 91 | image: *golang 92 | depends_on: vendor 93 | commands: 94 | - apk add make 95 | - make release 96 | when: 97 | event: tag 98 | 99 | release-binaries: 100 | image: woodpeckerci/plugin-release:0.2.5 101 | depends_on: build-binaries 102 | settings: 103 | api_key: 104 | from_secret: github_token 105 | files: 106 | - release/* 107 | title: ${CI_COMMIT_TAG##v} 108 | when: 109 | event: tag 110 | 111 | when: 112 | - event: pull_request 113 | - event: tag 114 | - event: push 115 | branch: 116 | - ${CI_REPO_DEFAULT_BRANCH} 117 | - renovate/* 118 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [2.6.5](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.6.5) - 2025-05-31 4 | 5 | ### ❤️ Thanks to all contributors! ❤️ 6 | 7 | @qwerty287 8 | 9 | ### 🐛 Bug Fixes 10 | 11 | - Always chmod workspace [[#240](https://github.com/woodpecker-ci/plugin-git/pull/240)] 12 | - Fix submodule override flag [[#241](https://github.com/woodpecker-ci/plugin-git/pull/241)] 13 | - Fix windows build [[#239](https://github.com/woodpecker-ci/plugin-git/pull/239)] 14 | 15 | ### 📦️ Dependency 16 | 17 | - chore(deps): update alpine docker tag to v3.22 [[#244](https://github.com/woodpecker-ci/plugin-git/pull/244)] 18 | 19 | ## [2.6.4](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.6.4) - 2025-05-27 20 | 21 | ### ❤️ Thanks to all contributors! ❤️ 22 | 23 | @qwerty287, @xoxys 24 | 25 | ### 🐛 Bug Fixes 26 | 27 | - Set umask to 0 before cloning [[#236](https://github.com/woodpecker-ci/plugin-git/pull/236)] 28 | 29 | ### 📚 Documentation 30 | 31 | - Clarify SSH key docs [[#235](https://github.com/woodpecker-ci/plugin-git/pull/235)] 32 | - Explain usage of chmod more detailed [[#216](https://github.com/woodpecker-ci/plugin-git/pull/216)] 33 | 34 | ### 📦️ Dependency 35 | 36 | - chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to v0.45.0 [[#234](https://github.com/woodpecker-ci/plugin-git/pull/234)] 37 | - fix(deps): update module github.com/urfave/cli/v3 to v3.3.3 [[#233](https://github.com/woodpecker-ci/plugin-git/pull/233)] 38 | - chore(deps): update dependency go to v1.24.3 [[#232](https://github.com/woodpecker-ci/plugin-git/pull/232)] 39 | - chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.6 [[#230](https://github.com/woodpecker-ci/plugin-git/pull/230)] 40 | - chore(deps): update woodpeckerci/plugin-docker-buildx docker tag to v6.0.1 [[#229](https://github.com/woodpecker-ci/plugin-git/pull/229)] 41 | - chore(deps): update woodpeckerci/plugin-docker-buildx docker tag to v6 [[#228](https://github.com/woodpecker-ci/plugin-git/pull/228)] 42 | - fix(deps): update module github.com/urfave/cli/v3 to v3.3.2 [[#227](https://github.com/woodpecker-ci/plugin-git/pull/227)] 43 | - fix(deps): update module github.com/urfave/cli/v3 to v3.3.1 [[#226](https://github.com/woodpecker-ci/plugin-git/pull/226)] 44 | - chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.5 [[#225](https://github.com/woodpecker-ci/plugin-git/pull/225)] 45 | - fix(deps): update module github.com/urfave/cli/v2 to v3 [[#220](https://github.com/woodpecker-ci/plugin-git/pull/220)] 46 | - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v3.2.0 [[#223](https://github.com/woodpecker-ci/plugin-git/pull/223)] 47 | - chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.2 [[#222](https://github.com/woodpecker-ci/plugin-git/pull/222)] 48 | - chore(deps): update pre-commit hook golangci/golangci-lint to v2.1.1 [[#221](https://github.com/woodpecker-ci/plugin-git/pull/221)] 49 | - chore(deps): update pre-commit hook golangci/golangci-lint to v2 [[#219](https://github.com/woodpecker-ci/plugin-git/pull/219)] 50 | - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v3.1.4 [[#218](https://github.com/woodpecker-ci/plugin-git/pull/218)] 51 | 52 | ## [2.6.3](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.6.3) - 2025-03-27 53 | 54 | ### ❤️ Thanks to all contributors! ❤️ 55 | 56 | @xoxys 57 | 58 | ### 🐛 Bug Fixes 59 | 60 | - Ensure fs mode for path is set correctly [[#215](https://github.com/woodpecker-ci/plugin-git/pull/215)] 61 | 62 | ### 📦️ Dependency 63 | 64 | - chore(deps): update woodpeckerci/plugin-docker-buildx docker tag to v5.2.2 [[#214](https://github.com/woodpecker-ci/plugin-git/pull/214)] 65 | - chore(deps): update woodpeckerci/plugin-release docker tag to v0.2.5 [[#213](https://github.com/woodpecker-ci/plugin-git/pull/213)] 66 | - chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.8 [[#212](https://github.com/woodpecker-ci/plugin-git/pull/212)] 67 | - chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.7 [[#211](https://github.com/woodpecker-ci/plugin-git/pull/211)] 68 | - fix(deps): update module github.com/urfave/cli/v2 to v2.27.6 [[#210](https://github.com/woodpecker-ci/plugin-git/pull/210)] 69 | 70 | ### Misc 71 | 72 | - [pre-commit.ci] pre-commit autoupdate [[#208](https://github.com/woodpecker-ci/plugin-git/pull/208)] 73 | 74 | ## [2.6.2](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.6.2) - 2025-02-26 75 | 76 | ### ❤️ Thanks to all contributors! ❤️ 77 | 78 | @pat-s 79 | 80 | ### Misc 81 | 82 | - Use alpine release to fix tag fetching [[#206](https://github.com/woodpecker-ci/plugin-git/pull/206)] 83 | 84 | ## [2.6.1](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.6.1) - 2025-02-21 85 | 86 | ### ❤️ Thanks to all contributors! ❤️ 87 | 88 | @miry 89 | 90 | ### 📦️ Dependency 91 | 92 | - chore(deps): update pre-commit hook golangci/golangci-lint to v1.64.5 [[#204](https://github.com/woodpecker-ci/plugin-git/pull/204)] 93 | - chore(deps): update golang docker tag to v1.24 [[#203](https://github.com/woodpecker-ci/plugin-git/pull/203)] 94 | - chore(deps): update woodpeckerci/plugin-release docker tag to v0.2.4 [[#202](https://github.com/woodpecker-ci/plugin-git/pull/202)] 95 | - chore(deps): update woodpeckerci/plugin-docker-buildx docker tag to v5.2.1 [[#201](https://github.com/woodpecker-ci/plugin-git/pull/201)] 96 | - chore(deps): update woodpeckerci/plugin-docker-buildx docker tag to v5.2.0 [[#200](https://github.com/woodpecker-ci/plugin-git/pull/200)] 97 | - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v3.1.3 [[#198](https://github.com/woodpecker-ci/plugin-git/pull/198)] 98 | - chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to v0.44.0 [[#199](https://github.com/woodpecker-ci/plugin-git/pull/199)] 99 | - chore(deps): update woodpeckerci/plugin-release docker tag to v0.2.3 [[#196](https://github.com/woodpecker-ci/plugin-git/pull/196)] 100 | - chore(deps): update pre-commit hook golangci/golangci-lint to v1.63.4 [[#195](https://github.com/woodpecker-ci/plugin-git/pull/195)] 101 | - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v3.1.1 [[#194](https://github.com/woodpecker-ci/plugin-git/pull/194)] 102 | - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v3.1.0 [[#192](https://github.com/woodpecker-ci/plugin-git/pull/192)] 103 | - chore(deps): update woodpeckerci/plugin-docker-buildx docker tag to v5.1.0 [[#191](https://github.com/woodpecker-ci/plugin-git/pull/191)] 104 | - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v3 [[#190](https://github.com/woodpecker-ci/plugin-git/pull/190)] 105 | - chore(deps): update woodpeckerci/plugin-release docker tag to v0.2.2 [[#189](https://github.com/woodpecker-ci/plugin-git/pull/189)] 106 | - chore(deps): update pre-commit hook golangci/golangci-lint to v1.62.2 [[#188](https://github.com/woodpecker-ci/plugin-git/pull/188)] 107 | - chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to v0.43.0 [[#186](https://github.com/woodpecker-ci/plugin-git/pull/186)] 108 | - chore(deps): update pre-commit hook golangci/golangci-lint to v1.62.0 [[#184](https://github.com/woodpecker-ci/plugin-git/pull/184)] 109 | - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v2.1.1 [[#183](https://github.com/woodpecker-ci/plugin-git/pull/183)] 110 | - fix(deps): update module github.com/adrg/xdg to v0.5.3 [[#182](https://github.com/woodpecker-ci/plugin-git/pull/182)] 111 | - fix(deps): update module github.com/adrg/xdg to v0.5.2 [[#181](https://github.com/woodpecker-ci/plugin-git/pull/181)] 112 | - fix(deps): update module github.com/urfave/cli/v2 to v2.27.5 [[#180](https://github.com/woodpecker-ci/plugin-git/pull/180)] 113 | - chore(deps): update woodpeckerci/plugin-docker-buildx docker tag to v5 [[#179](https://github.com/woodpecker-ci/plugin-git/pull/179)] 114 | - chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v5 [[#177](https://github.com/woodpecker-ci/plugin-git/pull/177)] 115 | - chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to v0.42.0 [[#176](https://github.com/woodpecker-ci/plugin-git/pull/176)] 116 | - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v2 [[#174](https://github.com/woodpecker-ci/plugin-git/pull/174)] 117 | 118 | ### Misc 119 | 120 | - Add docs about object-format option [[#185](https://github.com/woodpecker-ci/plugin-git/pull/185)] 121 | - [pre-commit.ci] pre-commit autoupdate [[#178](https://github.com/woodpecker-ci/plugin-git/pull/178)] 122 | 123 | ## [2.6.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.6.0) - 2024-09-20 124 | 125 | ### ❤️ Thanks to all contributors! ❤️ 126 | 127 | @6543 128 | 129 | ### ✨ Features 130 | 131 | - Support sha256 git repos [[#173](https://github.com/woodpecker-ci/plugin-git/pull/173)] 132 | 133 | ### Misc 134 | 135 | - chore(deps): update pre-commit hook golangci/golangci-lint to v1.61.0 [[#171](https://github.com/woodpecker-ci/plugin-git/pull/171)] 136 | - [pre-commit.ci] pre-commit autoupdate [[#172](https://github.com/woodpecker-ci/plugin-git/pull/172)] 137 | - chore(deps): update golang docker tag to v1.23 [[#169](https://github.com/woodpecker-ci/plugin-git/pull/169)] 138 | - chore(deps): update pre-commit hook golangci/golangci-lint to v1.60.1 [[#170](https://github.com/woodpecker-ci/plugin-git/pull/170)] 139 | - fix(deps): update module github.com/urfave/cli/v2 to v2.27.4 [[#166](https://github.com/woodpecker-ci/plugin-git/pull/166)] 140 | - [pre-commit.ci] pre-commit autoupdate [[#164](https://github.com/woodpecker-ci/plugin-git/pull/164)] 141 | - chore(deps): update woodpeckerci/plugin-release docker tag to v0.2.1 [[#165](https://github.com/woodpecker-ci/plugin-git/pull/165)] 142 | - fix(deps): update module github.com/urfave/cli/v2 to v2.27.3 [[#162](https://github.com/woodpecker-ci/plugin-git/pull/162)] 143 | 144 | ## [2.5.2](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.5.2) - 2024-07-26 145 | 146 | ### ❤️ Thanks to all contributors! ❤️ 147 | 148 | @j04n-f 149 | 150 | ### 🐛 Bug Fixes 151 | 152 | - Fetch using short commit SHA [[#160](https://github.com/woodpecker-ci/plugin-git/pull/160)] 153 | 154 | ## [2.5.1](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.5.1) - 2024-07-13 155 | 156 | ### ❤️ Thanks to all contributors! ❤️ 157 | 158 | @christoph-heiss, @qwerty287 159 | 160 | ### Misc 161 | 162 | - fix(deps): update module github.com/adrg/xdg to v0.5.0 [[#157](https://github.com/woodpecker-ci/plugin-git/pull/157)] 163 | - Explain setting `depth` to `0` effect [[#156](https://github.com/woodpecker-ci/plugin-git/pull/156)] 164 | - docs: fix typo in plugin feature description [[#154](https://github.com/woodpecker-ci/plugin-git/pull/154)] 165 | - Update pre-commit hook golangci/golangci-lint to v1.59.1 [[#153](https://github.com/woodpecker-ci/plugin-git/pull/153)] 166 | - Use `release` plugin [[#152](https://github.com/woodpecker-ci/plugin-git/pull/152)] 167 | - Update pre-commit non-major [[#150](https://github.com/woodpecker-ci/plugin-git/pull/150)] 168 | - Update woodpeckerci/plugin-ready-release-go Docker tag to v1.1.2 [[#149](https://github.com/woodpecker-ci/plugin-git/pull/149)] 169 | - Update pre-commit hook golangci/golangci-lint to v1.58.2 [[#148](https://github.com/woodpecker-ci/plugin-git/pull/148)] 170 | - Update pre-commit non-major [[#144](https://github.com/woodpecker-ci/plugin-git/pull/144)] 171 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v4 [[#146](https://github.com/woodpecker-ci/plugin-git/pull/146)] 172 | - Update module github.com/urfave/cli/v2 to v2.27.2 [[#143](https://github.com/woodpecker-ci/plugin-git/pull/143)] 173 | - Update woodpeckerci/plugin-github-release Docker tag to v1.2.0 [[#142](https://github.com/woodpecker-ci/plugin-git/pull/142)] 174 | - Update woodpeckerci/plugin-ready-release-go Docker tag to v1.1.1 [[#141](https://github.com/woodpecker-ci/plugin-git/pull/141)] 175 | - Update pre-commit hook pre-commit/pre-commit-hooks to v4.6.0 [[#140](https://github.com/woodpecker-ci/plugin-git/pull/140)] 176 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v3.2.1 [[#139](https://github.com/woodpecker-ci/plugin-git/pull/139)] 177 | - Update pre-commit hook golangci/golangci-lint to v1.57.2 [[#138](https://github.com/woodpecker-ci/plugin-git/pull/138)] 178 | - Update pre-commit hook golangci/golangci-lint to v1.57.1 [[#137](https://github.com/woodpecker-ci/plugin-git/pull/137)] 179 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v3.2.0 [[#136](https://github.com/woodpecker-ci/plugin-git/pull/136)] 180 | - Update woodpeckerci/plugin-github-release Docker tag to v1.1.2 [[#135](https://github.com/woodpecker-ci/plugin-git/pull/135)] 181 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v3.1.0 [[#132](https://github.com/woodpecker-ci/plugin-git/pull/132)] 182 | - Update golang Docker tag to v1.22 [[#131](https://github.com/woodpecker-ci/plugin-git/pull/131)] 183 | - [pre-commit.ci] pre-commit autoupdate [[#130](https://github.com/woodpecker-ci/plugin-git/pull/130)] 184 | - Renovate: Use org config [[#129](https://github.com/woodpecker-ci/plugin-git/pull/129)] 185 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v3.0.1 [[#128](https://github.com/woodpecker-ci/plugin-git/pull/128)] 186 | 187 | ## [2.5.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.5.0) - 2024-01-27 188 | 189 | ### ❤️ Thanks to all contributors! ❤️ 190 | 191 | @6543, @mhmdanas, @qwerty287 192 | 193 | ### 📈 Enhancement 194 | 195 | - Clone ref if `ref` setting is set [[#117](https://github.com/woodpecker-ci/plugin-git/pull/117)] 196 | - make add ".exe" on windows builds [[#112](https://github.com/woodpecker-ci/plugin-git/pull/112)] 197 | 198 | ### 📚 Documentation 199 | 200 | - Correct config options' names in `docs.md` [[#124](https://github.com/woodpecker-ci/plugin-git/pull/124)] 201 | - Add logo [[#123](https://github.com/woodpecker-ci/plugin-git/pull/123)] 202 | - Document SSH settings [[#116](https://github.com/woodpecker-ci/plugin-git/pull/116)] 203 | 204 | ### Misc 205 | 206 | - Update woodpeckerci/plugin-ready-release-go Docker tag to v1.1.0 [[#127](https://github.com/woodpecker-ci/plugin-git/pull/127)] 207 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v3 [[#126](https://github.com/woodpecker-ci/plugin-git/pull/126)] 208 | - Use cleartext user [[#125](https://github.com/woodpecker-ci/plugin-git/pull/125)] 209 | - Fix `depends_on`, take 2 [[#120](https://github.com/woodpecker-ci/plugin-git/pull/120)] 210 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v2.3.0 [[#122](https://github.com/woodpecker-ci/plugin-git/pull/122)] 211 | - [pre-commit.ci] pre-commit autoupdate [[#121](https://github.com/woodpecker-ci/plugin-git/pull/121)] 212 | - Fix `depends_on` [[#119](https://github.com/woodpecker-ci/plugin-git/pull/119)] 213 | - Use `depends_on` [[#118](https://github.com/woodpecker-ci/plugin-git/pull/118)] 214 | - Update module github.com/urfave/cli/v2 to v2.27.1 [[#115](https://github.com/woodpecker-ci/plugin-git/pull/115)] 215 | - Update module github.com/urfave/cli/v2 to v2.27.0 [[#114](https://github.com/woodpecker-ci/plugin-git/pull/114)] 216 | - Update module github.com/urfave/cli/v2 to v2.26.0 [[#110](https://github.com/woodpecker-ci/plugin-git/pull/110)] 217 | - Update woodpeckerci/plugin-ready-release-go Docker tag to v1.0.3 [[#109](https://github.com/woodpecker-ci/plugin-git/pull/109)] 218 | 219 | ## [2.4.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.4.0) - 2023-11-21 220 | 221 | ### ❤️ Thanks to all contributors! ❤️ 222 | 223 | @renovate[bot], @6543, @pat-s 224 | 225 | ### 📈 Enhancement 226 | 227 | - Shallow clone submodules by default [[#106](https://github.com/woodpecker-ci/plugin-git/pull/106)] 228 | - add precommit and linters [[#103](https://github.com/woodpecker-ci/plugin-git/pull/103)] 229 | 230 | ### Misc 231 | 232 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v2.2.1 [[#107](https://github.com/woodpecker-ci/plugin-git/pull/107)] 233 | 234 | ## [2.3.1](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.3.1) - 2023-11-11 235 | 236 | ### ❤️ Thanks to all contributors! ❤️ 237 | 238 | @renovate[bot] 239 | 240 | ### Misc 241 | 242 | - Update woodpeckerci/plugin-ready-release-go Docker tag to v1 [[#104](https://github.com/woodpecker-ci/plugin-git/pull/104)] 243 | 244 | ## [2.3.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.3.0) - 2023-11-08 245 | 246 | ### ❤️ Thanks to all contributors! ❤️ 247 | 248 | @renovate[bot], @6543, @pat-s, @crapStone 249 | 250 | ### 📈 Enhancement 251 | 252 | - move flags into own file [[#100](https://github.com/woodpecker-ci/plugin-git/pull/100)] 253 | 254 | ### 📚 Documentation 255 | 256 | - Use correct ref spec [[#97](https://github.com/woodpecker-ci/plugin-git/pull/97)] 257 | 258 | ### Misc 259 | 260 | - Update woodpeckerci/plugin-ready-release-go Docker tag to v0.7.0 [[#102](https://github.com/woodpecker-ci/plugin-git/pull/102)] 261 | - make sure setting safe-directory does not fail [[#101](https://github.com/woodpecker-ci/plugin-git/pull/101)] 262 | - Plugin github-release: inject the secret as an env var [[#96](https://github.com/woodpecker-ci/plugin-git/pull/96)] 263 | - Update woodpeckerci/plugin-docker-buildx Docker tag to v2.2.0 [[#99](https://github.com/woodpecker-ci/plugin-git/pull/99)] 264 | 265 | ## [2.2.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.2.0) - 2023-10-05 266 | 267 | ### ❤️ Thanks to all contributors! ❤️ 268 | 269 | @renovate[bot], @pat-s, @qwerty287, @fracai, @RayaneB75 270 | 271 | ### ✨ Features 272 | 273 | - Add option to use SSH for cloning repo [[#75](https://github.com/woodpecker-ci/plugin-git/pull/75)] 274 | 275 | ### 📈 Enhancement 276 | 277 | - Use woodpecker plugin instead of drone one [[#91](https://github.com/woodpecker-ci/plugin-git/pull/91)] 278 | - Add renovate config [[#89](https://github.com/woodpecker-ci/plugin-git/pull/89)] 279 | 280 | ### 🐛 Bug Fixes 281 | 282 | - Fix renovate labels [[#92](https://github.com/woodpecker-ci/plugin-git/pull/92)] 283 | 284 | ### 📚 Documentation 285 | 286 | - docs for remote, refs, sha, path [[#88](https://github.com/woodpecker-ci/plugin-git/pull/88)] 287 | 288 | ### Misc 289 | 290 | - Update golang Docker tag to v1.21 [[#94](https://github.com/woodpecker-ci/plugin-git/pull/94)] 291 | 292 | ## [2.1.2](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.1.2) - 2023-09-05 293 | 294 | ### ❤️ Thanks to all contributors! ❤️ 295 | 296 | @qwerty287 297 | 298 | ### 🐛 Bug Fixes 299 | 300 | - Fix SHA checkout on PRs [[#84](https://github.com/woodpecker-ci/plugin-git/pull/84)] 301 | 302 | ## [2.1.1](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.1.1) - 2023-08-13 303 | 304 | ### ❤️ Thanks to all contributors! ❤️ 305 | 306 | @qwerty287, @6543 307 | 308 | ### 🐛 Bug Fixes 309 | 310 | - Always checkout by SHA [[#76](https://github.com/woodpecker-ci/plugin-git/pull/76)] 311 | 312 | ### Misc 313 | 314 | - Cleanups and updates [[#78](https://github.com/woodpecker-ci/plugin-git/pull/78)] 315 | - Publish to quay.io too [[#74](https://github.com/woodpecker-ci/plugin-git/pull/74)] 316 | 317 | ## [2.1.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/2.1.0) - 2023-07-23 318 | 319 | ### ❤️ Thanks to all contributors! ❤️ 320 | 321 | @anbraten, @pat-s, @qwerty287, @ambroisie, @6543 322 | 323 | ### 📈 Enhancement 324 | 325 | - Add git `safe.directory` support [[#70](https://github.com/woodpecker-ci/plugin-git/pull/70)] 326 | - Use new env vars [[#71](https://github.com/woodpecker-ci/plugin-git/pull/71)] 327 | - Add os.Environ() for git commands environments [[#67](https://github.com/woodpecker-ci/plugin-git/pull/67)] 328 | 329 | ### 📚 Documentation 330 | 331 | - Change plugin name to "Git Clone" [[#61](https://github.com/woodpecker-ci/plugin-git/pull/61)] 332 | 333 | ### Misc 334 | 335 | - Add release helper [[#72](https://github.com/woodpecker-ci/plugin-git/pull/72)] 336 | 337 | ## [v2.0.3](https://github.com/woodpecker-ci/plugin-git/releases/tag/v2.0.3) - 2022-12-29 338 | 339 | - BUGFIXES 340 | - Fix write .netrc location with home var (#57) 341 | 342 | ## [v2.0.1](https://github.com/woodpecker-ci/plugin-git/releases/tag/v2.0.1) - 2022-12-21 343 | 344 | - BUGFIXES 345 | - Fix dockerfile to build correct go binary (#54) 346 | - Do not set GIT_TERMINAL_PROMPT=0 for git (#52) 347 | 348 | ## [v2.0.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/v2.0.0) - 2022-11-14 349 | 350 | - FEATURES 351 | - Partial clone by default (#48) 352 | - BUGFIXES 353 | - Make home var settable (#47) 354 | - ENHANCEMENTS 355 | - Publish semver images (#50) 356 | 357 | ## [v1.6.1](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.6.1) - 2022-11-06 358 | 359 | - BUGFIXES 360 | - Explicite set and check for home dir (#46) 361 | 362 | ## [v1.6.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.6.0) - 2022-10-13 363 | 364 | - BUGFIXES 365 | - Handle git-lfs separately (#40) 366 | - ENHANCEMENTS 367 | - if no branch info is set, fallback to default repo branch (#41) 368 | 369 | ## [v1.5.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.5.0) - 2022-10-06 370 | 371 | - ENHANCEMENTS 372 | - Release binarys (#37) 373 | - Use ref to checkout if no commit sha is set (#36) 374 | - Fix tests (#35) 375 | - MISC 376 | - Update urfave/cli to v2.17.1 (#38) 377 | - Use built-in log instead of logrus (#34) 378 | 379 | ## [v1.4.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.4.0) - 2022-08-30 380 | 381 | - ENHANCEMENTS 382 | - Auto enable tags clone if it's ci event is 'tag' (#30) 383 | - Support more architectures (#29) 384 | 385 | ## [v1.3.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.3.0) - 2022-08-15 386 | 387 | - FEATURES 388 | - Add option to Change branch name for checkout (#28) 389 | 390 | ## [v1.2.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.2.0) - 2022-05-25 391 | 392 | - FEATURES 393 | - Add git-lfs (#21) 394 | - Custom ssl certs for git (#19) 395 | - ENHANCEMENTS 396 | - Add an `lfs` setting which lets you disable Git LFS (#24) 397 | - DOCUMENTATION 398 | - Add docs page (#23) 399 | 400 | ## [v1.1.2](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.1.2) - 2022-01-30 401 | 402 | - BUGFIXES 403 | - Fix empty login/password in netrc (#20) 404 | 405 | ## [v1.1.1](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.1.1) - 2021-12-23 406 | 407 | - BUGFIXES 408 | - Fix version info (#13) 409 | 410 | ## [v1.1.0](https://github.com/woodpecker-ci/plugin-git/releases/tag/v1.1.0) - 2021-12-18 411 | 412 | - FEATURES 413 | - Add ppc64le support (#8) 414 | - BUGFIXES 415 | - Regognize "CI\_*" EnvVars (#6) 416 | - ENHANCEMENTS 417 | - Multiarch build (#8) 418 | - MISC 419 | - Upgrade urfave/cli to v2 (#5) 420 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./.git/*") 2 | GO_PACKAGES ?= $(shell go list ./... | grep -v /vendor/) 3 | 4 | GOOS ?= linux 5 | GOARCH ?= amd64 6 | TARGETOS ?= $(GOOS) 7 | TARGETARCH ?= $(GOARCH) 8 | 9 | BIN_SUFFIX := 10 | ifeq ($(TARGETOS),windows) 11 | BIN_SUFFIX := .exe 12 | endif 13 | 14 | VERSION ?= next 15 | ifneq ($(CI_COMMIT_TAG),) 16 | VERSION := $(CI_COMMIT_TAG:v%=%) 17 | endif 18 | 19 | # append commit-sha to next version 20 | BUILD_VERSION := $(VERSION) 21 | ifeq ($(BUILD_VERSION),next) 22 | CI_COMMIT_SHA ?= $(shell git rev-parse HEAD) 23 | BUILD_VERSION := $(shell echo "next-$(shell echo ${CI_COMMIT_SHA} | head -c 8)") 24 | endif 25 | 26 | LDFLAGS := -s -w -extldflags "-static" -X main.version=${BUILD_VERSION} 27 | 28 | .PHONY: all 29 | all: build 30 | 31 | .PHONY: vendor 32 | vendor: 33 | go mod tidy 34 | go mod vendor 35 | 36 | formatcheck: 37 | @([ -z "$(shell gofmt -d $(GOFILES_NOVENDOR) | head)" ]) || (echo "Source is unformatted"; exit 1) 38 | 39 | format: 40 | @gofmt -w ${GOFILES_NOVENDOR} 41 | 42 | .PHONY: clean 43 | clean: 44 | go clean -i ./... 45 | rm -rf release/ 46 | 47 | .PHONY: vet 48 | vet: 49 | @echo "Running go vet..." 50 | CGO_ENABLED=0 go vet $(GO_PACKAGES) 51 | 52 | .PHONY: test 53 | test: 54 | CGO_ENABLED=0 go test -cover ./... 55 | # we can not use "-race" as test trigger write to os.stdout 56 | 57 | build: 58 | CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags '${LDFLAGS}' -o release/plugin-git${BIN_SUFFIX} 59 | 60 | .PHONY: version 61 | version: 62 | @echo ${BUILD_VERSION} 63 | 64 | release-binaries: 65 | GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/linux-amd64_plugin-git 66 | GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/linux-arm64_plugin-git 67 | GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/linux-arm_plugin-git 68 | GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/windows-amd64_plugin-git.exe 69 | GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/windows-arm64_plugin-git.exe 70 | GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/darwin-amd64_plugin-git 71 | GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/darwin-arm64_plugin-git 72 | 73 | release-tarball: 74 | mkdir -p release 75 | tar -cvzf release/plugin-git-src-$(BUILD_VERSION).tar.gz \ 76 | vendor/ \ 77 | *.go \ 78 | go.??? \ 79 | LICENSE \ 80 | Makefile 81 | 82 | release-checksums: 83 | # generate shas for tar files 84 | (cd release/; sha256sum *plugin-git* > checksums.txt) 85 | 86 | .PHONY: release 87 | release: release-binaries release-tarball 88 | $(MAKE) release-checksums 89 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # plugin-git 2 | 3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |