File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Context } from '@actions/github/lib/context'
22import * as core from '@actions/core'
33import * as github from '@actions/github'
4- import { Octokit } from '@octokit/rest'
54import { RequestError } from '@octokit/request-error'
65import { PullRequestEvent } from '@octokit/webhooks-types'
76
@@ -188,9 +187,17 @@ export async function submitSnapshot(
188187 ...snapshot
189188 }
190189 )
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+ }
194201 } catch ( error ) {
195202 if ( error instanceof RequestError ) {
196203 core . error (
You can’t perform that action at this time.
0 commit comments