Skip to content

fix: Some random code for sanity checking #11

fix: Some random code for sanity checking

fix: Some random code for sanity checking #11

Workflow file for this run

name: Pull Requests
on:
pull_request:
branches: ["main"]
jobs:
build-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: webiny/action-conventional-commits@v1.2.0
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: "21"
distribution: "temurin"
cache: maven
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.0
# with:
# cache: npm
- name: Run OpenRewrite # TODO : open pr with all changes
run: ./mvnw rewrite:run -P pr
- name: Check if there are refactored changes
id: changes-openrewrite
uses: UnicornGlobal/has-changes-action@v1.0.11
- name: Run Spotless # TODO : open pr with all changes
run: ./mvnw spotless:apply -P pr
- name: Check if there are style changes
id: changes-spotless
uses: UnicornGlobal/has-changes-action@v1.0.11
- name: Push local changes
if: steps.changes-spotless.outputs.changed == 1 || steps.changes-openrewrite.outputs.changed
run: |
git config --global user.name "github-actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "style: Apply linting rules"
git push "https://${GITHUB_ACTOR}:${{ env.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:${{ github.ref_name }}-lint --force
shell: bash
- name: Process lint changes
if: steps.changes-spotless.outputs.changed == 1 || steps.changes-openrewrite.outputs.changed
uses: actions/github-script@v3
with:
script: |
core.setFailed('Repository was dirty after lint pass')
- name: Build with Maven
run: ./mvnw -B package -Drevision='${{ steps.increment-version.outputs.new-version }}' -Dchangelist='-SNAPSHOT' --file pom.xml -P pr