forked from kustomize-everything/action-promote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
162 lines (161 loc) · 6.08 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
---
name: Kustomize Image and Helm Promotion
description: Promote a tagged image or helm chart to a deployment repo using Kustomize and Git
branding:
icon: 'git-pull-request'
color: 'purple'
inputs:
git-commit-user:
description: Name to add to the Git Commit Message
required: false
default: Kustomize Everything
git-commit-email:
description: Email to add to the Git Commit Message
required: false
default: [email protected]
git-commit-message:
description: Commit message to use for deployment
required: false
github-token:
description: |
GitHub token for either opening pull requests or fetching metadata about
what is being promoted.
required: true
images:
description: |
A JSON list of images to promote. Each list item should be a dictionary
with the following keys:
- name: The name of the image in the target repository to update
- newName: The image name to promote
- newTag: The image tag to promote
OR
- fromOverlay: The name of the overlay to fetch the image details for
the named image from
- overlays: JSON list of overlays that this image should be promoted in
Either images or helm-charts or both must be specified.
default: "[]"
charts:
description: |
A JSON list of Helm charts to promote. Each list item should be a dictionary
with the following keys:
- name: The name of the chart in the target repository to update
- releaseName: The name of the release to promote
- version: The version of the chart to promote
OR
- fromOverlay: The name of the overlay to fetch the chart details for
the named chart from
- overlays: JSON list of overlays that this image should be promoted in
Either images or helm-charts or both must be specified.
default: "[]"
promotion-method:
description: |
How to handle the promotion. pull_request opens a PR against the
repository, ensures that all checks pass on the PR, and then
self-merges the PR. push will push the changes directly to the target
branch.
required: false
default: push
status-attempts:
description: |
The number of times to attempt to check the status of the PR before
giving up.
required: false
default: "10"
status-interval:
description: |
The number of seconds to wait between attempts to check the status of
the PR.
required: false
default: "30"
auto-merge:
description: |
Toggles the behavior of automatically merging the PR when using the pull_request
promotion method. If set to true, the PR will be automatically merged
when all checks pass. If set to false, the PR will be opened but not
merged.
required: false
default: "true"
labels:
description: |
Comma separated list of labels to add to the PR. Only used when promotion method
is pull_requets.
required: false
sha256-checksum:
description: Checksum of Kustomize version
required: false
default: 3b30477a7ff4fb6547fa77d8117e66d995c2bdd526de0dafbf8b7bcb9556c85d
target-repo:
description: The repo where the image promotion should be pushed
required: true
target-branch:
description: |
The branch where the image promotion should be pushed (defaults to main)
default: main
required: false
version:
description: Version of Kustomize to use
required: false
default: 5.1.1
working-directory:
description: |
Working directory where the deployment repo should be checked out into
required: false
default: image-promotion
dry-run:
description: |
If true, the action will not actually do anything. This is useful for
testing the action.
default: "false"
debug:
description: |
If true, the action will print out a lot of debug information.
default: "false"
aggregate-pr-changes:
description: If this is set to true, new changes will be aggregated in the existing open PR
default: "false"
pr-unique-key:
description: this key will be added to all your PR branch names if "aggregate-pr-changes" is set to true
default: "80514bedee3628f200f6"
outputs:
deployment-repo-sha:
description: "Git SHA of promotion commit on deployment repo"
deployment-repo-sha-url:
description: "Github URL for the promotion commit on the deployment URL"
deployment-repo-sha-short:
description: "Git short SHA of promotion commit on deployment repo."
images-updated:
description: "List of image name:tags that were promoted"
pull-request-url:
description: "URL for the pull request created during promotion"
runs:
using: 'docker'
# Use the Dockerfile in the same directory as this action.yml when we are
# testing changes to the underlying container. Otherwise, use the latest
# version of the container. This prevents the user from having to build
# the container themselves.
image: 'Dockerfile'
#image: 'docker://ghcr.io/kustomize-everything/action-promote:v4.2.1'
env:
GIT_COMMIT_USER: ${{ inputs.git-commit-user }}
GIT_COMMIT_EMAIL: ${{ inputs.git-commit-email }}
GIT_COMMIT_MESSAGE: ${{ inputs.git-commit-message }}
GITHUB_TOKEN: ${{ inputs.github-token }}
IMAGES: ${{ inputs.images }}
CHARTS: ${{ inputs.charts }}
PROMOTION_METHOD: ${{ inputs.promotion-method }}
AUTO_MERGE: ${{ inputs.auto-merge }}
LABELS: ${{ inputs.labels }}
STATUS_ATTEMPTS: ${{ inputs.status-attempts }}
STATUS_INTERVAL: ${{ inputs.status-interval }}
SSH_KEY: ${{ inputs.ssh-key }}
TARGET_REPO: ${{ inputs.target-repo }}
TARGET_BRANCH: ${{ inputs.target-branch }}
DEPLOYMENT_DIR: ${{ inputs.working-directory }}
DRY_RUN: ${{ inputs.dry-run }}
KUSTOMIZE_BIN_DIR: /opt/bin
KUSTOMIZE_FILENAME: kustomize_v${{ inputs.version }}_linux_amd64.tar.gz
KUSTOMIZE_SHA256_CHECKSUM: ${{ inputs.sha256-checksum }}
KUSTOMIZE_VERSION: ${{ inputs.version }}
DEBUG: ${{ inputs.debug }}
AGGREGATE_PR_CHANGES: ${{ inputs.aggregate-pr-changes }}
PR_UNIQUE_KEY: ${{ inputs.pr-unique-key }}