-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.73 KB
/
drift-check.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Drift check
on:
schedule:
# Run every day at 12 PM Europe/Oslo time
- cron: '0 12 * * *'
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
check-for-changes:
name: Check for changes
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Use Node LTS ✨
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm
- uses: 'google-github-actions/setup-gcloud@v2'
with:
install_components: 'gke-gcloud-auth-plugin'
- name: Authenticate with Google 🔑
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: Install dependencies 📦️
run: pnpm install --frozen-lockfile
- name: Run Pulumi 🚀
uses: pulumi/actions@v4
id: pulumi
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
with:
command: preview
refresh: true
stack-name: branches/branches-main/main
expect-no-changes: true
- uses: slackapi/slack-github-action@v1
if: failure()
with:
payload: |
{
"repository": "${{ github.repository }}",
"jobUrl": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"message": "Drift check failed",
"details": ${{ toJSON(steps.pulumi.outputs.output) }}
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DRIFTCHECK_WEBHOOK_URL }}