Skip to content

AUT-4213: Auth AWS account permission on KMS key #5840

AUT-4213: Auth AWS account permission on KMS key

AUT-4213: Auth AWS account permission on KMS key #5840

Workflow file for this run

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