-
Notifications
You must be signed in to change notification settings - Fork 45
53 lines (44 loc) · 1.66 KB
/
dispatch-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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 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}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
branch: update-version-v${{ TAG_NAME }}
title: "Update docs to use version v${{ TAG_NAME }}"
body: "Automatically generated PR to update documentation for version v${{ TAG_NAME }}"
commit-message: "Update docs to use version v${{ TAG_NAME }}"
author-name: "obol-platform"
author-email: "[email protected]"