Update log4j2 monorepo to v2.24.3 (#643) #577
This file contains 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: Publish Swagger Specs | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
- name: Set up Cache | |
uses: actions/cache@v4.2.0 | |
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: | |
distribution: "temurin" # See 'Supported distributions' for available options | |
java-version: 21 | |
cache: "gradle" | |
- name: Run Swagger Publisher | |
run: ./gradlew integration --tests uk.gov.hmcts.darts.common.config.SwaggerPublisherTest | |
- name: Commit to repository | |
run: | | |
mkdir swagger-staging | |
cd swagger-staging | |
git init | |
git config user.email "github-actions@users.noreply.github.com" | |
git config user.name "Darts Gateway GitHub action" | |
git remote add upstream https://${{ secrets.SWAGGER_PUBLISHER_API_TOKEN }}@github.com/hmcts/cnp-api-docs.git | |
git pull upstream master | |
repo=`echo "$GITHUB_REPOSITORY" | cut -f2- -d/` | |
echo "$(cat /tmp/swagger-specs.json)" > "docs/specs/$repo.json" | |
git add "docs/specs/$repo.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) |