Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub action for auto-updating GIT_TAG in readme #992

Merged
merged 2 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/readme-updater.yml
Original file line number Diff line number Diff line change
@@ -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}}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
andev0 marked this conversation as resolved.
Show resolved Hide resolved
FetchContent_MakeAvailable(cpr)
```

Expand Down