File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Enhancements
4
4
* Add ` Sort ` option to ` Agents ` and ` AgentPools ` , by @twitnithegirl [ #1229 ] ( https://github.com/hashicorp/go-tfe/pull/1229 )
5
+ * Add BETA support for Action invocations via ` CreateRunOptions ` by @mutahhir [ #1206 ] ( https://github.com/hashicorp/go-tfe/pull/1206 )
5
6
6
7
# v1.93.0
7
8
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ type Run struct {
140
140
ForceCancelAvailableAt time.Time `jsonapi:"attr,force-cancel-available-at,iso8601"`
141
141
HasChanges bool `jsonapi:"attr,has-changes"`
142
142
IsDestroy bool `jsonapi:"attr,is-destroy"`
143
+ InvokeActionAddrs []string `jsonapi:"attr,invoke-action-addrs,omitempty"`
143
144
Message string `jsonapi:"attr,message"`
144
145
Permissions * RunPermissions `jsonapi:"attr,permissions"`
145
146
PolicyPaths []string `jsonapi:"attr,policy-paths,omitempty"`
@@ -403,6 +404,9 @@ type RunCreateOptions struct {
403
404
// Variables allows you to specify terraform input variables for
404
405
// a particular run, prioritized over variables defined on the workspace.
405
406
Variables []* RunVariable `jsonapi:"attr,variables,omitempty"`
407
+
408
+ // Action Addresses to invoke.
409
+ InvokeActionAddrs []string `jsonapi:"attr,invoke-action-addrs,omitempty"`
406
410
}
407
411
408
412
// RunApplyOptions represents the options for applying a run.
Original file line number Diff line number Diff line change @@ -371,6 +371,23 @@ func TestRunsCreate(t *testing.T) {
371
371
assert .Contains (t , r .PolicyPaths , "./path/to/dir1" )
372
372
assert .Contains (t , r .PolicyPaths , "./path/to/dir2" )
373
373
})
374
+
375
+ t .Run ("with action invocations" , func (t * testing.T ) {
376
+ skipUnlessBeta (t )
377
+
378
+ opts := RunCreateOptions {
379
+ Message : String ("creating with policy paths" ),
380
+ Workspace : wTest ,
381
+ InvokeActionAddrs : []string {"actions.foo.bar" },
382
+ }
383
+
384
+ r , err := client .Runs .Create (ctx , opts )
385
+ require .NoError (t , err )
386
+ require .NotEmpty (t , r .InvokeActionAddrs )
387
+
388
+ assert .Len (t , r .InvokeActionAddrs , 1 )
389
+ assert .Contains (t , r .InvokeActionAddrs , "actions.foo.bar" )
390
+ })
374
391
}
375
392
376
393
func TestRunsRead_CostEstimate (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments