Skip to content

chore(deps): bump the k8s-go-deps group with 5 updates #199

chore(deps): bump the k8s-go-deps group with 5 updates

chore(deps): bump the k8s-go-deps group with 5 updates #199

name: Cleanup Website PR Preview
on:
pull_request_target:
types: [ closed ]
jobs:
cleanup:
runs-on: ubuntu-latest
if: github.repository == 'aws/karpenter-provider-aws'
permissions:
id-token: write
contents: read
steps:
- id: metadata
run: |
pr_number="${{ github.event.number }}"
echo PR_NUMBER="$pr_number" >> "$GITHUB_ENV"
echo BRANCH_NAME="pr-$pr_number" >> "$GITHUB_ENV"
- uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
with:
role-to-assume: arn:aws:iam::${{ vars.RELEASE_PREVIEW_ACCOUNT_ID }}:role/${{ vars.WEBSITE_ROLE_NAME }}
aws-region: ${{ vars.AMPLIFY_REGION }}
- run: |
if aws amplify get-branch --app-id ${{ vars.AMPLIFY_APP_ID_PREVIEW }} --branch-name "${{ env.BRANCH_NAME }}" 2>/dev/null; then
aws amplify delete-branch --app-id ${{ vars.AMPLIFY_APP_ID_PREVIEW }} --branch-name "${{ env.BRANCH_NAME }}"
fi
- run: aws s3 rm s3://${{ vars.AMPLIFY_S3_BUCKET_BETA }}/pr-${{ env.PR_NUMBER }}/ --recursive