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..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 0817715923c9705e68994eb52ef9df3f6845beba) # The commit hash for 1.10.x. Replace with the latest from: https://github.com/libcpr/cpr/releases + GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) # Replace with your desired git commit from: https://github.com/libcpr/cpr/releases FetchContent_MakeAvailable(cpr) ```