Skip to content

specmatic-core-release #43

specmatic-core-release

specmatic-core-release #43

name: Documentation Update
on:
repository_dispatch:
types: [specmatic-core-release]
workflow_dispatch:
inputs:
SPECMATIC_LATEST_RELEASE_VERSION_MANUAL:
description: 'Specmatic Latest Release Version e.g. v1.0.0'
required: true
type: string
default: ''
env:
SPECMATIC_LATEST_RELEASE_VERSION: ${{ github.event.client_payload.latest-release }}${{ github.event.inputs.SPECMATIC_LATEST_RELEASE_VERSION_MANUAL }}
jobs:
update_docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout documentation repository
uses: actions/checkout@v4
with:
repository: znsio/specmatic-documentation
fetch-depth: 0
ref: master
token: ${{ secrets.SPECMATIC_CORE_VERSION_UPDATE_TOKEN }}
path: documentation
- name: Update version in _config.yml
run: |
sed -i "s/latest_release: .*/latest_release: $SPECMATIC_LATEST_RELEASE_VERSION/" documentation/_config.yml
- name: Commit and push
run: |
git config --global user.name '${{ secrets.SPECMATIC_CORE_VERSION_UPDATE_USER_NAME }}'
git config --global user.email '${{ secrets.SPECMATIC_CORE_VERSION_UPDATE_USER_EMAIL }}'
git add .
git commit -m "Updated Specmatic Documentation Version To $SPECMATIC_LATEST_RELEASE_VERSION"
git push
working-directory: documentation