-
Notifications
You must be signed in to change notification settings - Fork 45
40 lines (37 loc) · 1.4 KB
/
delete-experiment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# This workflow can be run on any branch.
# Given an environment, this workflow will delete the branch's experiment from S3
name: Delete Experiment
on:
workflow_dispatch:
inputs:
nr_environment:
description: 'Target New Relic environment'
required: true
type: choice
options:
- dev
- staging
jobs:
delete-experiment-on-s3:
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.11.0 # See package.json for the stable node version that works with our testing. Do not change this unless you know what you are doing as some node versions do not play nicely with our testing server.
- name: Clean branch name
id: clean-branch-name
run: echo "results=$(echo '${{ github.ref }}' | sed 's/refs\/heads\///g' | sed 's/[^[:alnum:].-]/-/g')" >> $GITHUB_OUTPUT
- name: Delete experiment
id: s3-delete
uses: ./.github/actions/s3-delete
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_role: ${{ secrets.AWS_ROLE_ARN }}
aws_bucket_name: ${{ secrets.AWS_BUCKET }}
bucket_dir: experiments/${{ inputs.nr_environment }}/${{ steps.clean-branch-name.outputs.results }}