Skip to content

Check OpenAPI Spec Update #25

Check OpenAPI Spec Update

Check OpenAPI Spec Update #25

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: write
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: trigger-client-generation
name: Trigger Client Generation
if: ${{ env.RUST_CLIENT_VERSION != env.OPENAPI_VERSION }}
uses: peter-evans/repository-dispatch@v2
with:
event-type: update