-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Expand file tree
/
Copy pathenable-workflow.mjs
More file actions
42 lines (39 loc) · 1.01 KB
/
enable-workflow.mjs
File metadata and controls
42 lines (39 loc) · 1.01 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
import github from "../../github.app.mjs";
export default {
key: "github-enable-workflow",
name: "Enable Workflow",
description: "Enables a workflow and sets the **state** of the workflow to **active**. [See the documentation](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#enable-a-workflow)",
version: "0.0.7",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
github,
repoFullname: {
propDefinition: [
github,
"repoFullname",
],
},
workflowId: {
propDefinition: [
github,
"workflowId",
({ repoFullname }) => ({
repoFullname,
}),
],
},
},
async run({ $ }) {
const response = await this.github.enableWorkflow({
repoFullname: this.repoFullname,
workflowId: this.workflowId,
});
$.export("$summary", `Successfully enabled the workflow with Id: ${this.workflowId}!`);
return response;
},
};