File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { Context } from '@actions/github/lib/context'
2
2
import * as core from '@actions/core'
3
3
import * as github from '@actions/github'
4
- import { Octokit } from '@octokit/rest'
5
4
import { RequestError } from '@octokit/request-error'
6
5
import { PullRequestEvent } from '@octokit/webhooks-types'
7
6
@@ -188,9 +187,17 @@ export async function submitSnapshot(
188
187
...snapshot
189
188
}
190
189
)
191
- core . notice (
192
- 'Snapshot successfully created at ' + response . data . created_at . toString ( )
193
- )
190
+ const result = response . data . result
191
+ if ( result === 'SUCCESS' || result === 'ACCEPTED' ) {
192
+ core . notice (
193
+ 'Snapshot successfully created at ' +
194
+ response . data . created_at . toString ( )
195
+ )
196
+ } else {
197
+ core . error (
198
+ `Snapshot creation failed with result: "${ result } : ${ response . data . message } "`
199
+ )
200
+ }
194
201
} catch ( error ) {
195
202
if ( error instanceof RequestError ) {
196
203
core . error (
You can’t perform that action at this time.
0 commit comments