Cleanup Untracked App Config Profiles and Lambda Layer Versions #1
Workflow file for this run
This file contains 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: 'Cleanup Untracked App Config Profiles and Lambda Layer Versions' | |
on: | |
workflow_dispatch: | |
inputs: | |
build_branch: | |
description: 'Feature branch to push to sandbox.' | |
required: true | |
type: 'string' | |
sandbox: | |
description: 'Which Sandbox to push to.' | |
required: true | |
type: 'string' | |
environment: | |
default: "development" | |
description: "Which environment should this run against" | |
required: true | |
type: "string" | |
python_version: | |
description: "Version of Python to run the cleanup script against" | |
required: true | |
type: "string" | |
permissions: | |
pull-requests: write | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
cleanup_process: | |
runs-on: ubuntu-latest | |
environment: ${{ github.event.inputs.environment }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
repository: 'nhsconnect/national-document-repository-infrastructure' | |
ref: ${{ inputs.build_branch }} | |
fetch-depth: '0' | |
- name: Set up Python ${{ inputs.python_version }} | |
uses: actions/setup-python@v4 | |
with: | |
python_version: ${{ inputs.python_version }} | |
- name: Make virtual environment | |
run: | | |
python3 -m venv ./venv | |
./venv/bin/pip3 install --upgrade pip | |
./venv/bin/pip3 install boto3==1.33.11 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE }} | |
role-skip-session-tagging: true | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Run Version Cleanup Script | |
run: | | |
./venv/bin/python3 scripts/cleanup_versions.py ${{ inputs.sandbox }} |