Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spotlessCheck job to the security CI workflow #9839

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,41 @@ jobs:
html-to-markdown ${report}.html -o build/reports && \
cat ${report}.html.md >> $GITHUB_STEP_SUMMARY
fi

spotless-check:
if: github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
steven-sheehy marked this conversation as resolved.
Show resolved Hide resolved
name: Spotless Code Format Check
runs-on: mirror-node-linux-large
steven-sheehy marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
steven-sheehy marked this conversation as resolved.
Show resolved Hide resolved

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 21
steven-sheehy marked this conversation as resolved.
Show resolved Hide resolved

- name: Install JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: temurin
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4

- name: Execute Gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steven-sheehy marked this conversation as resolved.
Show resolved Hide resolved
run: ./gradlew spotlessCheck

- name: Fail on Unformatted Files
if: failure()
run: echo "Spotless check failed. Code formatting issues found. Please run './gradlew spotlessApply' locally and commit the changes."
Loading