You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-3Lines changed: 36 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,8 @@ The Overmind plugin installs the Overmind CLI (and GitHub CLI) and executes one
17
17
|`action`| The action to perform. Must be one of: `submit-plan`, `start-change`, `end-change`, `wait-for-simulation`| Yes |
18
18
|`api_key`| Overmind API key for authentication. Must have the following scopes: `account:read`, `changes:write`, `config:write`, `request:receive`, `sources:read`, `source:write`| Yes |
19
19
|`tags`| A comma-separated list of key=value tags to attach to the change (only used with `submit-plan` action) | No |
20
-
|`post_comment`| Whether `wait-for-simulation` should post the Overmind markdown to GitHub PR or GitLab MR. Defaults to `true` when running against a PR/MR, otherwise `false`. Automatically detects GitHub or GitLab based on repository URL. | No |
20
+
|`post_comment`| Whether `wait-for-simulation` should post the Overmind markdown to GitHub PR or GitLab MR. Defaults to `true` when running against a PR/MR, otherwise `false`. When `true`, `comment_provider` must be set. | No |
21
+
|`comment_provider`| Where `wait-for-simulation` should post comments when `post_comment=true`. Must be one of: `github`, `gitlab`. | No |
21
22
22
23
## Usage
23
24
@@ -90,7 +91,7 @@ deploy:
90
91
91
92
### Wait for Simulation (any step after Overmind run)
92
93
93
-
Fetch the latest Overmind simulation summary for the current env0 deployment and (optionally) comment on the matching GitHub pull request or GitLab merge request. By default the plugin posts comments whenever the deployment runs in the context of a PR/MR; set `post_comment: false` to skip commenting. The plugin automatically detects whether the repository is GitHub or GitLab based on the repository URL. When posting to GitHub, make sure `GH_TOKEN` is set. When posting to GitLab, make sure `GITLAB_TOKEN` is set.
94
+
Fetch the latest Overmind simulation summary for the current env0 deployment and (optionally) comment on the matching GitHub pull request or GitLab merge request. By default the plugin posts comments whenever the deployment runs in the context of a PR/MR; set `post_comment: false` to skip commenting. When `post_comment=true`, you must set `comment_provider` to `github` or `gitlab`. When posting to GitHub, make sure `GH_TOKEN` is set. When posting to GitLab, make sure `GITLAB_TOKEN` is set.
94
95
95
96
```yaml
96
97
version: 2
@@ -106,6 +107,38 @@ deploy:
106
107
post_comment: false # optional override
107
108
```
108
109
110
+
If you want to post a comment, set `comment_provider` explicitly:
111
+
112
+
```yaml
113
+
version: 2
114
+
deploy:
115
+
steps:
116
+
terraformApply:
117
+
after:
118
+
- name: Post Overmind Simulation (GitHub)
119
+
use: https://github.com/your-org/env0-plugin
120
+
inputs:
121
+
action: wait-for-simulation
122
+
api_key: ${OVERMIND_API_KEY}
123
+
post_comment: true
124
+
comment_provider: github
125
+
```
126
+
127
+
```yaml
128
+
version: 2
129
+
deploy:
130
+
steps:
131
+
terraformApply:
132
+
after:
133
+
- name: Post Overmind Simulation (GitLab)
134
+
use: https://github.com/your-org/env0-plugin
135
+
inputs:
136
+
action: wait-for-simulation
137
+
api_key: ${OVERMIND_API_KEY}
138
+
post_comment: true
139
+
comment_provider: gitlab
140
+
```
141
+
109
142
### Complete Example
110
143
111
144
Here's a complete example that uses the plan/change lifecycle actions:
@@ -192,7 +225,7 @@ deploy:
192
225
4. Generate the token and copy it immediately—GitLab will not show it again.
193
226
5. Store the token securely in env0 (for example as an environment variable or secret) and expose it to the plugin as `GITLAB_TOKEN`.
194
227
195
-
**Note**: The plugin automatically detects whether a repository is GitHub or GitLab based on the `ENV0_PR_SOURCE_REPOSITORY` environment variable. If the repository URL contains "gitlab", it will use GitLab API; otherwise, it will use GitHub CLI.
228
+
**Note**: When `post_comment=true`, you must set `comment_provider` to `github` or `gitlab`.
196
229
## Notes
197
230
198
231
- The plugin automatically detects the operating system and architecture to download the correct Overmind CLI binary.
Copy file name to clipboardExpand all lines: env0.plugin.yaml
+95-80Lines changed: 95 additions & 80 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,10 @@ inputs:
14
14
description: "The Overmind instance to connect to (defaults to https://app.overmind.tech)"
15
15
required: false
16
16
post_comment:
17
-
description: "Whether wait-for-simulation should post the Overmind markdown to the PR/MR. Defaults to true when ENV0_PR_NUMBER is set, otherwise false. Automatically detects GitHub or GitLab based on repository URL."
17
+
description: "Whether wait-for-simulation should post the Overmind markdown to the PR/MR. Defaults to true when ENV0_PR_NUMBER is set, otherwise false. When true, comment_provider must be set."
18
+
required: false
19
+
comment_provider:
20
+
description: "Where to post PR/MR comments when wait-for-simulation runs with post_comment=true. Must be one of: github, gitlab."
18
21
required: false
19
22
run:
20
23
exec: |
@@ -344,86 +347,98 @@ run:
344
347
echo "Error: ENV0_PR_SOURCE_REPOSITORY environment variable is not set but post_comment=true"
345
348
exit 1
346
349
fi
347
-
348
-
# Detect if this is a GitLab repository
349
-
if echo "${ENV0_PR_SOURCE_REPOSITORY}" | grep -q "gitlab"; then
350
-
# GitLab merge request
351
-
if [ -z "${GITLAB_TOKEN}" ]; then
352
-
echo "Error: GITLAB_TOKEN environment variable is not set but repository appears to be GitLab"
353
-
exit 1
354
-
fi
355
-
356
-
# Extract GitLab base URL and project path from repository string
357
-
# ENV0_PR_SOURCE_REPOSITORY format: "group/project" or "https://gitlab.com/group/project" or "gitlab.com/group/project"
358
-
REPO_STR="${ENV0_PR_SOURCE_REPOSITORY}"
359
-
360
-
# Remove protocol if present
361
-
REPO_STR=$(echo "${REPO_STR}" | sed 's|^https\?://||')
362
-
363
-
# Extract host (default to gitlab.com if not specified)
0 commit comments