mirror of
https://github.com/Alfresco/acs-community-packaging.git
synced 2026-09-16 18:13:21 +00:00
* ACS-9420 Reformat code and add pre-commit checks to CI * Trigger [reformat code] * Apply Pre-Commit code formatting --------- Co-authored-by: alfresco-build <alfresco-build@users.noreply.github.com>
40 lines
1.4 KiB
YAML
40 lines
1.4 KiB
YAML
name: Pre-Commit formatter
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- precommit/**
|
|
|
|
env:
|
|
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
|
|
|
|
jobs:
|
|
format-code:
|
|
name: "Reformat code"
|
|
runs-on: ubuntu-latest
|
|
if: contains(github.event.head_commit.message, '[reformat code]')
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
|
- name: Set up Python ${{ inputs.python-version }}
|
|
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
|
|
with:
|
|
python-version: "3.9"
|
|
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
|
|
continue-on-error: true
|
|
with:
|
|
extra_args: --all-files
|
|
- name: Update secrets baseline
|
|
run: pip install detect-secrets && detect-secrets scan --baseline .secrets.baseline
|
|
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.16.0
|
|
with:
|
|
username: ${{ secrets.BOT_GITHUB_USERNAME }}
|
|
add-options: -u
|
|
commit-message: "Apply Pre-Commit code formatting"
|
|
skip-if-no-changes: true
|
|
- name: Push changes
|
|
run: git push
|