-
Notifications
You must be signed in to change notification settings - Fork 360
42 lines (42 loc) · 1.77 KB
/
prepare-release.yaml
File metadata and controls
42 lines (42 loc) · 1.77 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
name: prepare-release
on:
workflow_dispatch:
inputs:
version:
description: "Next Version"
required: true
jobs:
prepare-release:
name: prepare for next release
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get current date
id: cdate
run: echo "::set-output name=date::$(date +'%Y.%m.%d')"
- name: Print variables
run: |
echo "Version :: ${{ github.event.inputs.version }}"
echo "Date :: ${{ steps.cdate.outputs.date }}"
- name: Replace lines
run: |
sed -E -i "s/<h4>Version \d+(\.\d+)*<\/h4>/<h4>Version ${{ github.event.inputs.version }}<\/h4>/" docs/index.md
sed -E -i "s/(<p.*>)[0-9]{4}\.[0-9]{2}\.[0-9]{2}<p>/\1${{ steps.cdate.outputs.date }}<p>/" docs/index.md
sed -E -i "s/(<a.*href=\"https:\/\/github.com\/Checkmarx\/kics\/releases\/download\/).*(\/kics_).*(_[a-z]+_.*>)/\1v${{ github.event.inputs.version }}\2${{ github.event.inputs.version }}\3/g" docs/index.md
- name: Create pull request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v6
with:
title: "docs(kicsbot): preparing for release ${{ github.event.inputs.version }}"
token: ${{ secrets.KICS_BOT_PAT }}
commit-message: "docs(kicsbot): preparing for release ${{ github.event.inputs.version }}"
delete-branch: true
branch: feature/kicsbot-update-docs-index
base: master
body: |
**Automated Changes**
Updating documentation index page.
Triggered by SHA: _${{ github.sha }}_
labels: documentation