setup user name and email #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Docs Version | |
on: | |
repository_dispatch: | |
types: [update-version] | |
push: | |
branches: | |
- fix_dispatch_trigger | |
jobs: | |
update-docs-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v3 | |
- name: Extract tag name | |
run: echo "TAG_NAME=${{ github.event.client_payload.tag }}" >> $GITHUB_ENV | |
- name: Set up Git user identity | |
run: | | |
git config --global user.name "obol-platform" | |
git config --global user.email "[email protected]" | |
- name: Set TAG_NAME environment variable | |
run: echo "TAG_NAME=v1.1.3" >> $GITHUB_ENV | |
- name: Update docs to new version | |
run: | | |
TAG_NAME="$(echo "${TAG_NAME}" | sed 's/^v//')" | |
# Update docs to use the new version | |
sed -i -E "s/v\.?[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9\-]*/v${TAG_NAME}/g" \ | |
docs/advanced/quickstart-split.md \ | |
docs/advanced/test-command.md \ | |
docs/advanced/quickstart-combine.md \ | |
docs/charon/charon-cli-reference.md \ | |
docs/faq/errors.mdx \ | |
docs/start/quickstart_group.mdx \ | |
docs/start/quickstart_alone.mdx | |
#install dependencies | |
yarn | |
# Update version with yarn | |
yarn run version v${TAG_NAME} | |
# Commit and push changes | |
git checkout -b update-version-${{ env.TAG_NAME }} | |
git add . | |
git commit -m "Update docs to use version v${TAG_NAME}" | |
git push origin update-version-${{ env.TAG_NAME }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
base: main | |
branch: update-version-${{ env.TAG_NAME }} | |
delete-branch: true | |
title: "Update docs to use version v${TAG_NAME}" | |
body: "Automatically generated PR to update documentation for version v${TAG_NAME}" |