diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fb6362..2cb84d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ This changlog uses the [ISO 8601 date format](https://www.iso.org/iso-8601-date- ## [Unreleased] +## [1.4.1] - 2021-01-31 + +### Changed + +* Update license date and add license to script + +### Fixed + +* Fixed Github API json escaping issue +* Added depcrecated warning about `--no-github` parameter + ## [1.4.0] - 2021-01-29 ### Added @@ -170,7 +181,8 @@ This changlog uses the [ISO 8601 date format](https://www.iso.org/iso-8601-date- ### Added - Initial release of the software -[Unreleased]: https://github.com/NicoHood/gpgit/compare/1.4.0...HEAD +[Unreleased]: https://github.com/NicoHood/gpgit/compare/1.4.1...HEAD +[1.4.1]: https://github.com/NicoHood/gpgit/compare/1.4.0...1.4.1 [1.4.0]: https://github.com/NicoHood/gpgit/compare/1.3.4...1.4.0 [1.3.4]: https://github.com/NicoHood/gpgit/compare/1.3.3...1.3.4 [1.3.3]: https://github.com/NicoHood/gpgit/compare/1.3.2...1.3.3 diff --git a/LICENSE b/LICENSE index e8f1fa9..4459e47 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016 NicoHood +Copyright (c) 2016-2021 NicoHood Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Readme.md b/Readme.md index 0cfde07..63a5321 100644 --- a/Readme.md +++ b/Readme.md @@ -52,13 +52,14 @@ The security status of GNU/Linux projects will be tracked in the [Linux Security * [Arch Linux](https://archlinux.org/packages/community/any/gpgit/) `sudo pacman -S gpgit` ### Manual Installation + ```bash # Install dependencies and optional dependencies sudo apt-get install bash gnupg2 git tar xz-utils coreutils gawk grep sed sudo apt-get install gzip bzip lzip file jq curl # Download and verify source -VERSION=1.4.0 +VERSION=1.4.1 wget "https://github.com/NicoHood/gpgit/releases/download/${VERSION}/gpgit-${VERSION}.tar.xz" wget "https://github.com/NicoHood/gpgit/releases/download/${VERSION}/gpgit-${VERSION}.tar.xz.asc" gpg2 --keyserver hkps://keyserver.ubuntu.com --recv-keys 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161 @@ -83,7 +84,7 @@ If you add and commit a `CHANGELOG.md` file to your Git with the [Keep a Changel $ gpgit --help Usage: gpgit [options] [ | ] -GPGit 1.4.0 https://github.com/NicoHood/gpgit +GPGit 1.4.1 https://github.com/NicoHood/gpgit A shell script that automates the process of signing Git sources via GPG. Mandatory arguments: diff --git a/gpgit.sh b/gpgit.sh index bc252ea..e126ffb 100755 --- a/gpgit.sh +++ b/gpgit.sh @@ -1,5 +1,26 @@ #!/usr/bin/env bash -VERSION="1.4.0" + +# Copyright (c) 2016-2021 NicoHood +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +# OR OTHER DEALINGS IN THE SOFTWARE. + +VERSION="1.4.1" # Avoid any encoding problems export LANG=C @@ -255,6 +276,7 @@ while true ; do ;; # DEPRECATED: use '--github false' or git config 'gpgit.github false' -n|--no-github) + INTERACTIVE=false warning "Parameter '--no-github' is deprecated. Please use '--github false' instead." GITHUB="false" ;; -f|--force) @@ -778,8 +800,13 @@ else warning "Publishing release on default Github branch '${BRANCH}'." fi - API_JSON="$(printf '{"tag_name": "%s","target_commitish": "%s","name": "%s","body": "%s","draft": false,"prerelease": %s}' \ - "${TAG}" "${BRANCH}" "${TAG}" "${MESSAGE//$'\n'/'\n'}" "${PRERELEASE}")" + API_JSON="$(jq -n -c -M \ + --arg tag_name "${TAG}" \ + --arg target_commitish "${BRANCH}" \ + --arg name "${TAG}" \ + --arg body "${MESSAGE}" \ + --argjson prerelease "${PRERELEASE}" \ + '{tag_name: $tag_name, target_commitish: $target_commitish, name: $name, body: $body, draft: false, prerelease: $prerelease}')" if ! GITHUB_RELEASE="$(curl --proto-redir =https -s --data "${API_JSON}" \ "https://github.com/gitapi/repos/${GITHUB_REPO_NAME}/releases" \ -H "Accept: application/vnd.github.v3+json" \