-
Notifications
You must be signed in to change notification settings - Fork 71
43 lines (37 loc) · 1.31 KB
/
release-docs.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
name: Create Docs PR
on:
push:
tags:
- 'v[0-9]+.[0-9]+.0' # run this workflow when a new minor version is published
permissions:
contents: write
pull-requests: write
jobs:
create-docs-pr:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.3.1
with:
egress-policy: audit
- name: Get version from tag
shell: bash
run: |
TAG="$(echo "${{ github.ref }}" | tr -d 'refs/tags/v')"
MAJOR_VERSION="$(echo "${TAG}" | cut -d '.' -f1)"
MINOR_VERSION="$(echo "${TAG}" | cut -d '.' -f2)"
echo "NEWVERSION=v${MAJOR_VERSION}.${MINOR_VERSION}.x" >> ${GITHUB_ENV}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Generate versioned docs
shell: bash
run: make version-docs
- name: Create release pull request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
commit-message: "chore: Generate ${{ env.NEWVERSION }} docs"
title: "chore: Generate ${{ env.NEWVERSION }} docs"
branch: "release-${{ env.NEWVERSION }}"
base: "main"
signoff: true