-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (46 loc) · 1.52 KB
/
update-snapshots.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
name: update-snapshots
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
concurrency: ${{ github.workflow }}-${{ github.head_ref }}
jobs:
update:
name: Update Snapshots
runs-on: ubuntu-latest
permissions:
contents: write
env:
CI: "true"
CHECKPOINT_DISABLE: "1"
HEAD_REF: ${{ github.event.pull_request.head.ref }}
container:
image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: ensure correct user
run: chown -R root /__w/cdktf-integration-serverless-example/
- name: Set git identity
run: |-
git config user.name "team-tf-cdk"
git config user.email "[email protected]"
- name: Install
run: yarn install
- name: Run snapshot update
run: yarn test -- --passWithNoTests --updateSnapshot
continue-on-error: true
- name: Check if there are any changes
id: get_changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Push changes to branch
if: steps.get_changes.outputs.changed != 0
run: |-
git add .
git commit -s -m "chore: update snapshots for tests"
git push origin HEAD:$HEAD_REF