-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (37 loc) · 1.18 KB
/
pr-environment-destroy.yml
File metadata and controls
44 lines (37 loc) · 1.18 KB
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
41
42
43
44
name: PR Environment Destroy
run-name: Destroy PR Environment ${{ inputs.pr_number }}
on:
workflow_call:
inputs:
app_name:
required: true
type: string
environment:
required: true
type: string
pr_number:
required: true
type: string
concurrency: pr-environment-${{ inputs.app_name }}-${{ inputs.pr_number }}
jobs:
destroy:
name: Destroy environment
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
pull-requests: write # Needed to comment on PR
repository-projects: read # Workaround for GitHub CLI bug https://github.com/cli/cli/issues/6274
steps:
- uses: actions/checkout@v4
- name: Set up Terraform
uses: ./.github/actions/setup-terraform
- name: Configure AWS credentials
uses: ./.github/actions/configure-aws-credentials
with:
app_name: ${{ inputs.app_name }}
environment: ${{ inputs.environment }}
- name: Destroy environment
run: ./bin/destroy-pr-environment "${{ inputs.app_name }}" "${{ inputs.environment }}" "${{ inputs.pr_number }}"
env:
GH_TOKEN: ${{ github.token }}