AUT-4213: Auth AWS account permission on KMS key #5840
This file contains hidden or 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: pre-commit | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- ready_for_review | |
- synchronize | |
push: | |
branches: | |
- main | |
merge_group: | |
jobs: | |
noop-on-merge-group: | |
if: github.event_name == 'merge_group' | |
runs-on: ubuntu-latest | |
name: Run pre-commit # important this is the same name as the pre-commit job | |
steps: | |
- name: π Skip Pre-commit Checks for Merge Group | |
run: echo "This is a merge group event. Skipping pre-commit checks."; true | |
shell: bash | |
pre-commit: | |
# This job will run on all pull requests and pushes to main, but not on merge groups | |
# We run it on merge to main to ensure that pre-commit's cache is up to date | |
if: github.event_name != 'merge_group' | |
runs-on: ubuntu-latest | |
name: Run pre-commit # important this is the same name as the noop-on-merge-group job | |
steps: | |
- name: π¦ Check Out Repository Code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: ποΈ Set Up JDK 17 | |
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 #v4.7.1 | |
with: | |
java-version: "17" | |
distribution: "corretto" | |
- name: ποΈ Set Up Gradle | |
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4 | |
with: | |
cache-read-only: false | |
add-job-summary: never | |
- name: ποΈ Set Up Python | |
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 | |
with: | |
python-version: "3.x" | |
cache: "pip" | |
- name: ποΈ Set Up Terraform | |
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
- name: ποΈ Install Pre-commit | |
run: python -m pip install pre-commit | |
shell: bash | |
- name: π οΈ Freeze Python Dependencies | |
run: python -m pip freeze --local | |
shell: bash | |
- name: π¦ Cache Pre-commit tools | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
restore-keys: | | |
pre-commit-3|${{ env.pythonLocation }}| | |
pre-commit-3| | |
- name: β Run Pre-commit Hooks | |
run: | | |
pre-commit run --show-diff-on-failure --color=always \ | |
--from-ref "${{ github.event.pull_request.base.sha }}" \ | |
--to-ref "${{ github.event.pull_request.head.sha }}" | |
shell: bash | |
- name: π§Ή Cache Cleanup | |
run: pre-commit gc | |
shell: bash |