diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c6942bb --- /dev/null +++ b/.github/workflows/ci.yml @@ -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" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4ccf8cf --- /dev/null +++ b/.pre-commit-config.yaml @@ -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