-
Notifications
You must be signed in to change notification settings - Fork 70
54 lines (46 loc) · 1.94 KB
/
patch-docs.yaml
File metadata and controls
54 lines (46 loc) · 1.94 KB
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
54
name: patch_docs
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[1-9]+' # run this workflow when a new patch version is published
permissions:
contents: write
pull-requests: write
jobs:
patch-docs:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- name: Set release version and target branch for vNext
if: github.event_name == 'push'
run: |
TAG="$(echo "${{ github.ref }}" | tr -d 'refs/tags/v')"
MAJOR_VERSION="$(echo "${TAG}" | cut -d '.' -f1)"
echo "MAJOR_VERSION=${MAJOR_VERSION}" >> ${GITHUB_ENV}
MINOR_VERSION="$(echo "${TAG}" | cut -d '.' -f2)"
echo "MINOR_VERSION=${MINOR_VERSION}" >> ${GITHUB_ENV}
PATCH_VERSION="$(echo "${TAG}" | cut -d '.' -f3)"
echo "PATCH_VERSION=${PATCH_VERSION}" >> ${GITHUB_ENV}
echo "TAG=${TAG}" >> ${GITHUB_ENV}
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
with:
fetch-depth: 0
- name: Create release branch if needed # patched docs are always being merged to the main branch
run: |
git checkout main
- name: Create patch version docs
run: make patch-version-docs NEWVERSION=v${MAJOR_VERSION}.${MINOR_VERSION}.x TAG=v${TAG} OLDVERSION=v${MAJOR_VERSION}.${MINOR_VERSION}.$((PATCH_VERSION-1))
- name: Create release pull request
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
with:
commit-message: "chore: Patch docs for ${{ env.TAG }} release"
title: "chore: Patch docs for ${{ env.TAG }} release"
branch: "patch-docs-${{ env.TAG }}"
base: "main"
signoff: true
labels: |
release-pr
${{ github.event.inputs.release_version }}