From 87405dbc8791ffcfead1f5dff503e6829c84f0e3 Mon Sep 17 00:00:00 2001 From: Alexis Tual Date: Thu, 28 Nov 2024 11:28:26 +0100 Subject: [PATCH 1/2] Add prerequisites to README, in particular Git CLI config --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d046e3b..de553aa 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,42 @@ The Wrapper Upgrade Gradle Plugin creates tasks to upgrade the Gradle Wrapper for target projects hosted on GitHub. +## Prerequisites + +To run the upgrade tasks, you'll need: + +* **Java 8 or later.** +* **Git CLI.** The plugin uses the Git CLI to commit, create branches, and push changes. + + * **Git author identity:** Make sure your Git author identity is configured. You can set this with: + + ```bash + git config --global user.name "Your Name" + git config --global user.email "your.email@example.com" + ``` + + **Using GPG Signing (Optional):** If you use GitHub Actions and want to sign your commits with GPG, you can use the [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) action. This action imports your GPG key **and** configures the Git author identity. + + ```yaml + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 + with: + gpg_private_key: ${{ secrets.MY_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.MY_GPG_PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true + git_config_global: true + ``` + + * **Git credentials:** If you use GitHub Actions, you can configure your Git credentials from a GitHub token with this trick: + + ```yaml + - name: Set up Git credentials + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: git config --global url."https://unused-username:${TOKEN}@github.com/".insteadOf "https://github.com/" + ``` + ## Usage Apply the plugin to a dedicated project and configure which project needs to be upgraded. Example: @@ -101,7 +137,6 @@ Note that a check is done first to make sure the branch does not exist yet. That Running `upgradeMavenWrapperXXX` will do the same, executing `./mvnw wrapper:wrapper -Dmaven=` instead. - ### Configuration ``` From 3ce3c012c0daabd172c8e33a98023e0fc2bb9701 Mon Sep 17 00:00:00 2001 From: Alexis Tual Date: Thu, 28 Nov 2024 14:17:47 +0100 Subject: [PATCH 2/2] Use 'Git' instead of 'Git CLI' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de553aa..9fd64ee 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The Wrapper Upgrade Gradle Plugin creates tasks to upgrade the Gradle Wrapper fo To run the upgrade tasks, you'll need: * **Java 8 or later.** -* **Git CLI.** The plugin uses the Git CLI to commit, create branches, and push changes. +* **Git.** The plugin uses Git commands to commit, create branches, and push changes. * **Git author identity:** Make sure your Git author identity is configured. You can set this with: