fix: Some random code for sanity checking #13
Workflow file for this run
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: 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/[email protected] | |
- 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/[email protected] | |
# 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/[email protected] | |
- 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/[email protected] | |
- 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:refs/heads/linting/${{ github.head_ref }} --force | |
gh pr create -B ${{ github.head_ref }} -H ${{ github.head_ref }}-lint -a ${{ github.event.pull_request.user.login }} -T 'Apply linting rules and refactorings for ${{ github.head_ref }}' | |
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 |