Skip to content

Use correct working directory #2

Use correct working directory

Use correct working directory #2

Workflow file for this run

on:
push:
branches:
- "**"
- "!main"
paths:
- "src/**"
- ".github/workflows/generate-java.yml"
jobs:
generate-java:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.DAPLA_BOT_APP_ID }}
private-key: ${{ secrets.DAPLA_BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}
- name: Configure Git
run: |
git config user.name "dapla-bot[bot]"
git config user.email "143391972+dapla-bot[bot]@users.noreply.github.com"
- name: Generate Java
run: |
pushd generated/java/datadoc-model
./mvnw jsonschema2pojo:generate
popd
- name: Check for modified files
id: git-check
run: echo modified=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi) >> $GITHUB_OUTPUT
- name: Commit
if: steps.git-check.outputs.modified == 'true'
run: |
git add -A
git commit -m '[GENERATE] Java classes from JSON Schema'
- name: Push
uses: ad-m/[email protected]
with:
github_token: ${{ steps.generate_token.outputs.token }}
branch: ${{ github.ref }}