-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
66 lines (59 loc) · 2.02 KB
/
action.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
66
name: Reusable GitHub Sync PR
description: |
This action runs the pulumi preview when opening a PR.
inputs:
work_dir:
required: false
description: 'Where the Pulumi config are located.'
config_directory:
required: false
description: 'Where the Github config are located.'
stack_name:
required: true
description: 'Pulumi stack name.'
pulumi_access_token:
required: true
description: 'Secret for accessing Pulumi.'
pulumi_command:
required: true
description: 'What command to run when running Pulumi action. Options: preview and up.(default: preview)'
default: 'preview'
comment_on_pr:
required: false
description: 'Used when doing a Pulumi preview for Pull Requests'
default: 'false'
gh_token:
required: true
description: 'GitHub Token with pull_request scope to be able to post comments in the PR'
runs:
using: "composite"
steps:
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: '${{ github.action_path }}/go.mod'
check-latest: true
cache-dependency-path: '${{ github.action_path }}/go.sum'
- name: Set env
run: echo "PULUMI_GO_CODE=${GITHUB_ACTION_PATH}" >> $GITHUB_ENV
shell: bash
- name: Copy config to run pulumi
run: |
cp -r ${{ inputs.config_directory }} $GITHUB_ACTION_PATH
cp ${{ inputs.work_dir }}/Pulumi*.yaml $GITHUB_ACTION_PATH
shell: bash
- name: Go mod download
run: go mod download
working-directory: '${{ env.PULUMI_GO_CODE }}'
shell: bash
- uses: pulumi/actions@c7fad9e2f0b79653172b36538b8b34b3c0291952 # v6.0.0
with:
command: '${{ inputs.pulumi_command }}'
stack-name: '${{ inputs.stack_name }}'
refresh: false
work-dir: '${{ env.PULUMI_GO_CODE }}'
comment-on-pr: ${{ inputs.comment_on_pr }}
github-token: ${{ inputs.gh_token }}
diff: true
edit-pr-comment: true
env:
PULUMI_ACCESS_TOKEN: ${{ inputs.pulumi_access_token }}