Skip to content

Commit 6caa493

Browse files
committed
bump @actions/attest from 1.1.0 to 1.2.1
Signed-off-by: Brian DeHamer <bdehamer@github.com>
1 parent 5353367 commit 6caa493

File tree

6 files changed

+1917
-77
lines changed

6 files changed

+1917
-77
lines changed

__tests__/main.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as github from '@actions/github'
1111
import { mockFulcio, mockRekor, mockTSA } from '@sigstore/mock'
1212
import * as oci from '@sigstore/oci'
1313
import nock from 'nock'
14+
import { MockAgent, setGlobalDispatcher } from 'undici'
1415
import { SEARCH_PUBLIC_GOOD_URL } from '../src/endpoints'
1516
import * as main from '../src/main'
1617

@@ -31,6 +32,10 @@ summaryWriteMock.mockImplementation(async () => Promise.resolve(core.summary))
3132
// Mock the action's main function
3233
const runMock = jest.spyOn(main, 'run')
3334

35+
// MockAgent for mocking @actions/github
36+
const mockAgent = new MockAgent()
37+
setGlobalDispatcher(mockAgent)
38+
3439
describe('action', () => {
3540
// Capture original environment variables and GitHub context so we can restore
3641
// them after each test
@@ -63,8 +68,12 @@ describe('action', () => {
6368
.query({ audience: 'sigstore' })
6469
.reply(200, { value: oidcToken })
6570

66-
nock('https://api.github.com')
67-
.post(/^\/repos\/.*\/.*\/attestations$/)
71+
mockAgent
72+
.get('https://api.github.com')
73+
.intercept({
74+
path: /^\/repos\/.*\/.*\/attestations$/,
75+
method: 'post'
76+
})
6877
.reply(201, { id: attestationID })
6978

7079
process.env = {

0 commit comments

Comments
 (0)