-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathaction.yml
More file actions
65 lines (59 loc) · 1.96 KB
/
Copy pathaction.yml
File metadata and controls
65 lines (59 loc) · 1.96 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
57
58
59
60
61
62
63
64
65
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@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: '${{ github.action_path }}/go.mod'
check-latest: true
cache: false
- name: Copy config to run pulumi
env:
CONFIG_DIRECTORY: ${{ inputs.config_directory }}
WORK_DIR: ${{ inputs.work_dir }}
run: |
cp -r ${CONFIG_DIRECTORY} $GITHUB_ACTION_PATH
cp ${WORK_DIR}/Pulumi*.yaml $GITHUB_ACTION_PATH
shell: bash
- name: Go mod download
run: go mod download
working-directory: '${{ github.action_path }}'
shell: bash
- uses: pulumi/actions@8e5e406f4007fca908480587cb9893c07090f58d # v7.0.0
with:
command: '${{ inputs.pulumi_command }}'
stack-name: '${{ inputs.stack_name }}'
refresh: false
work-dir: '${{ github.action_path }}'
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 }}