-
Notifications
You must be signed in to change notification settings - Fork 63
38 lines (31 loc) · 1.17 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
name: Update Docs Version
on:
repository_dispatch:
types: [update-version]
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: Update docs to new version
run: |
LATEST_VERSION=$(jq -r '.[0]' versions.json)
find docs -type f -exec sed -i -E "s/$LATEST_VERSION/${TAG_NAME}/g" {} +
#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-${{ env.TAG_NAME }}
title: "Update docs to use version ${{ env.TAG_NAME }}"
body: "Automatically generated PR to update documentation for version ${{ env.TAG_NAME }}"
commit-message: "Update docs to use version ${{ env.TAG_NAME }}"
author-name: "obol-platform"
author-email: "[email protected]"