@@ -12,14 +12,14 @@ external GitHub get github;
12
12
@anonymous
13
13
extension type GitHub ._(JSObject it) {
14
14
/// The GitHub context this action is running in.
15
- ///
15
+ ///
16
16
/// See: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
17
17
external GitHubContext get context;
18
18
}
19
19
20
20
/// A typed representation of the `github` context object.
21
- ///
22
- /// See also:
21
+ ///
22
+ /// See also:
23
23
/// - https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
24
24
/// - https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
25
25
@JS ('github.Context' )
@@ -28,102 +28,102 @@ extension type GitHubContext._(JSObject it) {
28
28
external WebhookPayload get payload;
29
29
30
30
/// The name of the event that triggered the workflow run.
31
- ///
31
+ ///
32
32
/// From the `GITHUB_EVENT_NAME` environment variable.
33
33
external String get eventName;
34
34
35
- /// The commit SHA that triggered the workflow.
36
- ///
37
- /// The value of this commit SHA depends on the event that triggered the workflow.
35
+ /// The commit SHA that triggered the workflow.
36
+ ///
37
+ /// The value of this commit SHA depends on the event that triggered the workflow.
38
38
/// For more information, see [Events that trigger workflows] (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).
39
- ///
39
+ ///
40
40
/// For example, `ffac537e6cbbf934b08745a378932722df287a53` .
41
- ///
41
+ ///
42
42
/// From the `GITHUB_SHA` environment variable.
43
43
external String get sha;
44
44
45
- /// The fully-formed ref of the branch or tag that triggered the workflow run.
46
- ///
47
- /// For workflows triggered by push, this is the branch or tag ref that was pushed.
48
- /// For workflows triggered by pull_request, this is the pull request merge branch.
49
- /// For workflows triggered by release, this is the release tag created. For other
50
- /// triggers, this is the branch or tag ref that triggered the workflow run.
51
- ///
52
- /// This is only set if a branch or tag is available for the event type. The ref given
53
- /// is fully-formed, meaning that for branches the format is `refs/heads/<branch_name>` ,
54
- /// for pull requests it is `refs/pull/<pr_number>/merge` , and for tags it is
55
- /// `refs/tags/<tag_name>` .
56
- ///
45
+ /// The fully-formed ref of the branch or tag that triggered the workflow run.
46
+ ///
47
+ /// For workflows triggered by push, this is the branch or tag ref that was pushed.
48
+ /// For workflows triggered by pull_request, this is the pull request merge branch.
49
+ /// For workflows triggered by release, this is the release tag created. For other
50
+ /// triggers, this is the branch or tag ref that triggered the workflow run.
51
+ ///
52
+ /// This is only set if a branch or tag is available for the event type. The ref given
53
+ /// is fully-formed, meaning that for branches the format is `refs/heads/<branch_name>` ,
54
+ /// for pull requests it is `refs/pull/<pr_number>/merge` , and for tags it is
55
+ /// `refs/tags/<tag_name>` .
56
+ ///
57
57
/// For example, `refs/heads/feature-branch-1` .
58
- ///
58
+ ///
59
59
/// From the `GITHUB_REF` environment variable.
60
60
external String get ref;
61
61
62
- /// The name of the workflow. If the workflow file doesn't specify a `name` , the value of
62
+ /// The name of the workflow. If the workflow file doesn't specify a `name` , the value of
63
63
/// this property is the full path of the workflow file in the repository.
64
- ///
64
+ ///
65
65
/// From the `GITHUB_WORKFLOW` environment variable.
66
66
external String get workflow;
67
67
68
- /// The name of the action currently running, or the `id` of a step.
69
- ///
70
- /// GitHub removes special characters, and uses the name `__run` when the current step runs
71
- /// a script without an `id` . If you use the same action more than once in the same job,
72
- /// the name will include a suffix with the sequence number with underscore before it.
73
- ///
74
- /// For example, the first script you run will have the name `__run` , and the second script
75
- /// will be named `__run_2` . Similarly, the second invocation of `actions/checkout` will be
68
+ /// The name of the action currently running, or the `id` of a step.
69
+ ///
70
+ /// GitHub removes special characters, and uses the name `__run` when the current step runs
71
+ /// a script without an `id` . If you use the same action more than once in the same job,
72
+ /// the name will include a suffix with the sequence number with underscore before it.
73
+ ///
74
+ /// For example, the first script you run will have the name `__run` , and the second script
75
+ /// will be named `__run_2` . Similarly, the second invocation of `actions/checkout` will be
76
76
/// `actionscheckout2` .
77
- ///
77
+ ///
78
78
/// From the `GITHUB_ACTION` environment variable.
79
79
external String get action;
80
80
81
- /// The username of the user that triggered the initial workflow run.
82
- ///
83
- /// If the workflow run is a re-run, this value may differ from `github.triggering_actor` .
84
- /// Any workflow re-runs will use the privileges of `github.actor` , even if the actor initiating
81
+ /// The username of the user that triggered the initial workflow run.
82
+ ///
83
+ /// If the workflow run is a re-run, this value may differ from `github.triggering_actor` .
84
+ /// Any workflow re-runs will use the privileges of `github.actor` , even if the actor initiating
85
85
/// the re-run (`github.triggering_actor` ) has different privileges.
86
- ///
86
+ ///
87
87
/// From the `GITHUB_ACTOR` environment variable.
88
88
external String get actor;
89
89
90
90
/// The `job_id` of the current job.
91
- ///
92
- /// **Note:** This context property is set by the Actions runner, and is only available within
91
+ ///
92
+ /// **Note:** This context property is set by the Actions runner, and is only available within
93
93
/// the execution `steps` of a job. Otherwise, the value of this property will be `null` .
94
- ///
94
+ ///
95
95
/// From the `GITHUB_JOB` environment variable.
96
96
external String get job;
97
97
98
- /// A unique number for each run of a particular workflow in a repository.
99
- ///
100
- /// This number begins at 1 for the workflow's first run, and increments with each new run. This
98
+ /// A unique number for each run of a particular workflow in a repository.
99
+ ///
100
+ /// This number begins at 1 for the workflow's first run, and increments with each new run. This
101
101
/// number does not change if you re-run the workflow run.
102
- ///
102
+ ///
103
103
/// From the `GITHUB_RUN_NUMBER` environment variable.
104
104
external int get runNumber;
105
105
106
- /// A unique number for each workflow run within a repository.
107
- ///
106
+ /// A unique number for each workflow run within a repository.
107
+ ///
108
108
/// This number does not change if you re-run the workflow run.
109
- ///
109
+ ///
110
110
/// From the `GITHUB_RUN_ID` environment variable.
111
111
external int get runId;
112
112
113
113
/// The URL of the GitHub REST API.
114
- ///
114
+ ///
115
115
/// From the `GITHUB_API_URL` environment variable.
116
116
external String get apiUrl;
117
117
118
- /// The URL of the GitHub server.
119
- ///
118
+ /// The URL of the GitHub server.
119
+ ///
120
120
/// For example: `https://github.com` .
121
- ///
121
+ ///
122
122
/// From the `GITHUB_SERVER_URL` environment variable.
123
123
external String get serverUrl;
124
124
125
125
/// The URL of the GitHub GraphQL API.
126
- ///
126
+ ///
127
127
/// From the `GITHUB_GRAPHQL_URL` environment variable.
128
128
external String get graphqlUrl;
129
129
@@ -133,56 +133,57 @@ extension type GitHubContext._(JSObject it) {
133
133
/// The repo from which this action was run.
134
134
external GitHubRepo get repo;
135
135
136
- /// The name of the base ref or target branch of the pull request in a workflow run.
137
- ///
136
+ /// The name of the base ref or target branch of the pull request in a workflow run.
137
+ ///
138
138
/// This is only set when the event that triggers a workflow run is either `pull_request`
139
- /// or `pull_request_target` .
140
- ///
139
+ /// or `pull_request_target` .
140
+ ///
141
141
/// For example, `main` .
142
- ///
142
+ ///
143
143
/// From the `GITHUB_BASE_REF` environment variable.
144
144
String ? get baseRef => process.getEnv ('GITHUB_BASE_REF' );
145
145
146
- /// The head ref or source branch of the pull request in a workflow run.
147
- ///
148
- /// This property is only set when the event that triggers a workflow run is either
149
- /// `pull_request` or `pull_request_target` .
150
- ///
146
+ /// The head ref or source branch of the pull request in a workflow run.
147
+ ///
148
+ /// This property is only set when the event that triggers a workflow run is either
149
+ /// `pull_request` or `pull_request_target` .
150
+ ///
151
151
/// For example, feature-branch-1.
152
- ///
152
+ ///
153
153
/// From the `GITHUB_HEAD_REF` environment variable.
154
154
String ? get headRef => process.getEnv ('GITHUB_HEAD_REF' );
155
155
156
- /// The short ref name of the branch or tag that triggered the workflow run.
157
- ///
158
- /// This value matches the branch or tag name shown on GitHub.
159
- ///
156
+ /// The short ref name of the branch or tag that triggered the workflow run.
157
+ ///
158
+ /// This value matches the branch or tag name shown on GitHub.
159
+ ///
160
160
/// For example, `feature-branch-1` .
161
- ///
161
+ ///
162
162
/// From the `GITHUB_REF_NAME` environment variable.
163
163
String get refName => process.getEnv ('GITHUB_REF_NAME' )! ;
164
164
165
- /// The type of ref that triggered the workflow run.
166
- ///
165
+ /// The type of ref that triggered the workflow run.
166
+ ///
167
167
/// Valid values are `branch` or `tag` .
168
- ///
168
+ ///
169
169
/// From the `GITHUB_REF_TYPE` environment variable.
170
170
GitHubRefType get refType => GitHubRefType .values.byName (
171
- process.getEnv ('GITHUB_REF_TYPE' )! ,
172
- );
173
-
174
- /// A unique number for each attempt of a particular workflow run in a repository.
175
- ///
176
- /// This number begins at `1` for the workflow run's first attempt, and increments
177
- /// with each re-run.
178
- ///
171
+ process.getEnv ('GITHUB_REF_TYPE' )! ,
172
+ );
173
+
174
+ /// A unique number for each attempt of a particular workflow run in a repository.
175
+ ///
176
+ /// This number begins at `1` for the workflow run's first attempt, and increments
177
+ /// with each re-run.
178
+ ///
179
179
/// For example, `3` .
180
- ///
180
+ ///
181
181
/// From the `GITHUB_RUN_ATTEMPT` environment variable.
182
182
int get runAttempt => int .parse (process.getEnv ('GITHUB_RUN_ATTEMPT' )! );
183
183
184
184
/// The URL to this workflow's run.
185
- String get workflowRunUrl => '$serverUrl /${repo .owner }/${repo .repo }/actions/runs/$runId ' ;
185
+ String get workflowRunUrl =>
186
+ '$serverUrl /${repo .owner }/${repo .repo }/actions/runs/$runId ' ;
186
187
}
187
188
188
189
enum GitHubRefType { branch, tag }
@@ -211,7 +212,7 @@ extension type WebhookPayload._(JSObject it) implements JSObject {
211
212
@anonymous
212
213
extension type PullRequest ._(JSObject it) implements JSObject {
213
214
external int get number;
214
-
215
+
215
216
@JS ('html_url' )
216
217
external String ? get htmlUrl;
217
218
external String ? get body;
0 commit comments