Skip to content

When the FF is off, the call to the API isn't made. Removed the FF #658

When the FF is off, the call to the API isn't made. Removed the FF

When the FF is off, the call to the API isn't made. Removed the FF #658

name: Remove test admin deployment
on:
pull_request:
branches:
- main
types:
- closed
env:
AWS_DEFAULT_REGION: ca-central-1
FUNCTION_NAME: "notify-admin-pr"
GITHUB_SHA: ${{ github.sha }}
IMAGE: notify/admin
REGISTRY: 239043911459.dkr.ecr.ca-central-1.amazonaws.com
jobs:
remove-test-admin:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'Renovate') }}
runs-on: ubuntu-latest
steps:
- name: Set envs
run: echo "PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")" >> $GITHUB_ENV
- name: Configure AWS credentials
id: aws-creds
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
with:
aws-access-key-id: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
aws-region: ca-central-1
- name: Delete lambda function resources
run: |
aws lambda wait function-active --function-name $FUNCTION_NAME-$PR_NUMBER
aws lambda delete-function-url-config --function-name $FUNCTION_NAME-$PR_NUMBER
aws lambda delete-function --function-name $FUNCTION_NAME-$PR_NUMBER
aws logs delete-log-group --log-group-name /aws/lambda/$FUNCTION_NAME-$PR_NUMBER
aws ecr batch-delete-image --repository-name $IMAGE --image-ids imageTag=$PR_NUMBER