Skip to content

CME-109: Update CaseEventToFields tab to include NullifyByDefault as … #507

CME-109: Update CaseEventToFields tab to include NullifyByDefault as …

CME-109: Update CaseEventToFields tab to include NullifyByDefault as … #507

Workflow file for this run

name: Publish Swagger Specs
on:
push:
branches:
- master
- RDM-10747
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Cache
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- name: Run Swagger Publisher
run: ./gradlew application:test --tests uk.gov.hmcts.net.ccd.definition.store.SwaggerGeneratorTest
- name: Commit to repository
run: |
mkdir swagger-staging
cd swagger-staging
git init
git config user.email "[email protected]"
git config user.name "GitHub action"
git remote add upstream "https://jenkins-reform-hmcts:${{ secrets.GH_TOKEN }}@github.com/hmcts/cnp-api-docs.git"
git pull upstream master
repo=`echo "$GITHUB_REPOSITORY" | cut -f2- -d/`
echo "$(cat /tmp/ccd-definition-store-api.json)" > "docs/specs/ccd-definition-store-api.json"
git add "docs/specs/ccd-definition-store-api.json"
# Only commit and push if we have changes.
git diff --quiet && git diff --staged --quiet || (git commit -m "Update spec for $repo#${GITHUB_SHA:7}"; git push --set-upstream upstream master)