Skip to content

Check OpenAPI Spec Update #6

Check OpenAPI Spec Update

Check OpenAPI Spec Update #6

Workflow file for this run

name: Check OpenAPI Spec Update
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- id: checkout
name: Checkout repo
uses: actions/checkout@v4
- id: read-rust-client-version
name: Read Rust Client Version
run: |
RUST_CLIENT_VERSION=$(yq e '.package.version' ./rust-client/Cargo.toml)
echo "RUST_CLIENT_VERSION=$RUST_CLIENT_VERSION" >> $GITHUB_ENV
- id: download-openapi-spec
name: Download FattureInCloud OpenAPI spec file
run: wget https://github.com/fattureincloud/openapi-fattureincloud/raw/master/openapi-enriched.yaml -O fattureincloud-openapi.yaml
- id: read-new-openapi-version
name: Read New OpenAPI Version
run: |
OPENAPI_VERSION=$(yq e '.info.version' ./fattureincloud-openapi.yaml)
echo "OPENAPI_VERSION=$OPENAPI_VERSION" >> $GITHUB_ENV
- id: compare-release
name: Compare with previous release
run: |
if [ "${{ env.RUST_CLIENT_VERSION }}" != "${{ env.OPENAPI_VERSION }}" ]; then
echo "release_changed=true" >> $GITHUB_OUTPUT
echo "Release changed: true"
else
echo "release_changed=false" >> $GITHUB_OUTPUT
echo "Release changed: false"
fi
- name: Trigger Client Generation
if: ${{ env.release_changed == true }}
uses: peter-evans/repository-dispatch@v2
with:
event-type: update