Skip to content

Commit

Permalink
Add pre-commit and run scan in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpage-alfresco committed May 8, 2024
1 parent 28474e2 commit 73b7e0d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Yet Another PMD Scan GitHub Action

on:
pull_request:
branches:
- feature/**
- fix/**
- master
- release/**
push:
branches:
- feature/**
- fix/**
- master
- release/**

jobs:
pre_commit:
runs-on: ubuntu-latest
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2
- uses: actions/checkout@v3
- id: changed-files
uses: tj-actions/changed-files@7fc073d92265804a8d4e4982b637dee053daf6c5 # v42.0.7
- name: Store changed files in env
run: echo "GITHUB_MODIFIED_FILES=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_ENV
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v1.35.2

test_checksum:
name: "Unit tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: .
with:
create-github-annotations: "false"
classpath-enable: "false"
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: 001e16323a2f0162336345f4ceb6d72c204980b5 # v1.4.0
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: fix-byte-order-marker
- id: end-of-file-fixer
- id: mixed-line-ending
- id: detect-aws-credentials
args:
- --allow-missing-credentials
- id: detect-private-key
- id: check-case-conflict
- id: check-yaml
- id: trailing-whitespace

0 comments on commit 73b7e0d

Please sign in to comment.