Skip to content

Add dispatchable workflow for deleting test model runs #13

Add dispatchable workflow for deleting test model runs

Add dispatchable workflow for deleting test model runs #13

# Workflow that can be manually dispatched to delete test model runs that
# do not need to be persisted indefinitely.
#
# Gated such that it's impossible to delete runs older than the current
# assessment cycle, where each assessment cycle starts in April.
name: delete-model-runs
on:
pull_request:
jobs:
delete-model-runs:
runs-on: ubuntu-latest
permissions:
# Needed to interact with GitHub's OIDC Token endpoint so we can auth AWS
contents: read
id-token: write
steps:
- name: Checkout repo code
uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install system dependencies
run: sudo apt-get install libgit2-dev
shell: bash
- name: Disable renv sandbox to speed up install time
run: echo "RENV_CONFIG_SANDBOX_ENABLED=FALSE" >> .Renviron
shell: bash
- name: Setup renv
uses: r-lib/actions/setup-renv@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_MODEL_DELETION_ARN }}
aws-region: us-east-1
- name: Delete model runs
run: Rscript ./R/delete_current_year_model_runs.R "$RUN_IDS"
shell: bash
env:
RUN_IDS: 2024-11-14-foo-bar,2024-11-15-baz