From 132a46b55f530bbb8955c5d7689268d4212acab2 Mon Sep 17 00:00:00 2001 From: andev0 <50714887+andev0@users.noreply.github.com> Date: Thu, 14 Dec 2023 22:07:54 +0100 Subject: [PATCH 1/2] GitHub action for auto-updating GIT_TAG in readme --- .github/workflows/readme-updater.yml | 27 +++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/readme-updater.yml diff --git a/.github/workflows/readme-updater.yml b/.github/workflows/readme-updater.yml new file mode 100644 index 000000000..be6470c46 --- /dev/null +++ b/.github/workflows/readme-updater.yml @@ -0,0 +1,27 @@ +name: Update GIT_TAG In Readme +on: + release: + types: [published] + +# Workflow configuration +env: + OUTPUT_BRANCH: "master" + COMMIT_MESSAGE: "Update GIT_TAG on new release" + +jobs: + update-git-tag: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v3 + with: + ref: ${{github.sha}} + - name: "Replace GIT_TAG" + run: sed -i -re 's/(GIT_TAG) [0-9a-f]+/\1 ${{github.sha}}/' README.md + - name: "Commit changes" + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: ${{env.COMMIT_MESSAGE}} + branch: ${{env.OUTPUT_BRANCH}} diff --git a/README.md b/README.md index 9408241cd..036bbe934 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Add the following to your `CMakeLists.txt`. ```cmake include(FetchContent) FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git - GIT_TAG 0817715923c9705e68994eb52ef9df3f6845beba) # The commit hash for 1.10.x. Replace with the latest from: https://github.com/libcpr/cpr/releases + GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) FetchContent_MakeAvailable(cpr) ``` From dcfaf058c4d50d6b9835115b0bb1419e12ad8c2a Mon Sep 17 00:00:00 2001 From: andev0 <50714887+andev0@users.noreply.github.com> Date: Sat, 16 Dec 2023 10:59:57 +0100 Subject: [PATCH 2/2] Added a comment with a commit tag tip to readme Co-authored-by: Fabian Sauter --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 036bbe934..8623ac0f8 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Add the following to your `CMakeLists.txt`. ```cmake include(FetchContent) FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git - GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) + GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) # Replace with your desired git commit from: https://github.com/libcpr/cpr/releases FetchContent_MakeAvailable(cpr) ```