-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (48 loc) · 1.82 KB
/
e2e-reset.yml
File metadata and controls
56 lines (48 loc) · 1.82 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
45
46
47
48
49
50
51
52
53
54
55
56
on:
schedule:
- cron: '0 18 * * *' # runs every day at 6PM UTC
workflow_dispatch:
name: E2E reset
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
e2e:
name: E2E reset
runs-on: namespace-profile-sdk
steps:
- name: Setup 1Password
uses: 1password/load-secrets-action/configure@8d0d610af187e78a2772c2d18d627f4c52d3fbfb # v3
with:
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- name: Load secrets
uses: 1password/load-secrets-action@8d0d610af187e78a2772c2d18d627f4c52d3fbfb # v3
with:
export-env: true
env:
E2E_GITHUB_TOKEN: "op://platform/SDK E2E/github-token"
SETTLEMINT_ACCESS_TOKEN_E2E_TESTS: "op://platform/SDK E2E/pat-token"
SETTLEMINT_INSTANCE: "op://platform/SDK E2E/instance"
- name: Checkout repository
uses: namespacelabs/nscloud-checkout-action@0c5e6ce59a41299aba2ad91baa0126f1bfde8e5c # v8
- name: Login to SettleMint and delete workspace
uses: settlemint/settlemint-action@main
if: ${{ env.SETTLEMINT_WORKSPACE != '' }}
env:
SETTLEMINT_WORKSPACE: ${{ secrets.SETTLEMINT_WORKSPACE }}
with:
instance: ${{ env.SETTLEMINT_INSTANCE }}
access-token: ${{ env.SETTLEMINT_ACCESS_TOKEN_E2E_TESTS }}
auto-connect: false
workspace: ${{ secrets.SETTLEMINT_WORKSPACE }}
command: platform delete workspace --accept-defaults --force default
- name: Delete all secrets
run: |
echo $E2E_GITHUB_TOKEN | gh auth login --with-token
gh secret list | while read -r secret _; do
gh secret delete "$secret"
done
env:
E2E_GITHUB_TOKEN: ${{ env.E2E_GITHUB_TOKEN }}