Skip to content

New CSV implementation #692

New CSV implementation

New CSV implementation #692

name: Preview Generated Code
permissions:
contents: write
statuses: write
on:
pull_request:
types:
- edited
- opened
- synchronize
- converted_to_draft
- ready_for_review
jobs:
build_preview_generated_code:
name: Build Preview of Generated Code
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Configure Git User
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
- name: Run Gradle task
run: ./gradlew processKDocsMain korro
- name: Check for changes in generated sources
id: git-diff
run: echo "changed=$(if git diff --quiet './core/generated-sources' './dataframe-csv/generated-sources' './docs/StardustDocs/snippets' './docs/StardustDocs/topics'; then echo 'false'; else echo 'true'; fi)" >> $GITHUB_OUTPUT
- name: Commit and push if changes
id: git-commit
if: steps.git-diff.outputs.changed == 'true'
run: |
git checkout -b generated-sources/docs-update-${{ github.run_number }}
git add './core/generated-sources' './dataframe-csv/generated-sources' './docs/StardustDocs/snippets' './docs/StardustDocs/topics'
git commit -m "Update generated sources with recent changes"
git push origin generated-sources/docs-update-${{ github.run_number }}
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Update status to PR
uses: actions/github-script@v7
if: steps.git-diff.outputs.changed == 'true'
with:
# language=js
script: |
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.pull_request.head.sha,
state: "success",
target_url: "https://github.com/${{ github.repository }}/commit/${{ steps.git-commit.outputs.commit }}",
context: "Generated sources will change, merging this PR",
description: "Check 'Details' to inspect changes ->"
});