prepare-release #85
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |