7
7
8
8
9
9
10
- var _chunkOLZEGNJMjs = require ( './chunk-OLZEGNJM .js' ) ;
10
+ var _chunk1js = require ( './chunk1 .js' ) ;
11
11
12
12
// src/main.ts
13
- var core2 = _chunkOLZEGNJMjs . __toESM . call ( void 0 , _chunkOLZEGNJMjs . require_core . call ( void 0 , ) ) ;
13
+ var core2 = _chunk1js . __toESM . call ( void 0 , _chunk1js . require_core . call ( void 0 , ) ) ;
14
14
15
15
// src/registry_url.ts
16
- var core = _chunkOLZEGNJMjs . __toESM . call ( void 0 , _chunkOLZEGNJMjs . require_core . call ( void 0 , ) ) ;
16
+ var core = _chunk1js . __toESM . call ( void 0 , _chunk1js . require_core . call ( void 0 , ) ) ;
17
17
function getAudienceFromUrl ( url ) {
18
18
const audience = url . replace ( / ^ h t t p s ? : \/ \/ / , "" ) ;
19
19
if ( audience . startsWith ( "http://" ) || audience . startsWith ( "https://" ) ) {
@@ -32,16 +32,16 @@ function getRegistryUrl() {
32
32
}
33
33
34
34
// src/main.ts
35
- _chunkOLZEGNJMjs . runAction . call ( void 0 , run ) ;
35
+ _chunk1js . runAction . call ( void 0 , run ) ;
36
36
async function run ( ) {
37
37
checkPermissions ( ) ;
38
38
const registryUrl = getRegistryUrl ( ) ;
39
39
const audience = getAudienceFromUrl ( registryUrl ) ;
40
40
const jwtToken = await getJwtToken ( audience ) ;
41
41
const token = await requestTrustedPublishingToken ( registryUrl , jwtToken ) ;
42
42
setTokenOutput ( token ) ;
43
- core2 . saveState ( _chunkOLZEGNJMjs . TOKEN_KEY , token ) ;
44
- core2 . saveState ( _chunkOLZEGNJMjs . REGISTRY_URL_KEY , registryUrl ) ;
43
+ core2 . saveState ( _chunk1js . TOKEN_KEY , token ) ;
44
+ core2 . saveState ( _chunk1js . REGISTRY_URL_KEY , registryUrl ) ;
45
45
}
46
46
function checkPermissions ( ) {
47
47
if ( process . env . ACTIONS_ID_TOKEN_REQUEST_URL === void 0 || ! process . env . ACTIONS_ID_TOKEN_REQUEST_URL ) {
@@ -60,8 +60,8 @@ async function getJwtToken(audience) {
60
60
return jwtToken ;
61
61
}
62
62
async function requestTrustedPublishingToken ( registryUrl , jwtToken ) {
63
- const tokenUrl = _chunkOLZEGNJMjs . getTokensEndpoint . call ( void 0 , registryUrl ) ;
64
- const userAgent = _chunkOLZEGNJMjs . getUserAgent . call ( void 0 , ) ;
63
+ const tokenUrl = _chunk1js . getTokensEndpoint . call ( void 0 , registryUrl ) ;
64
+ const userAgent = _chunk1js . getUserAgent . call ( void 0 , ) ;
65
65
core2 . info (
66
66
`Requesting token from: ${ tokenUrl } . User agent: ${ userAgent [ "User-Agent" ] } `
67
67
) ;
@@ -75,14 +75,14 @@ async function requestTrustedPublishingToken(registryUrl, jwtToken) {
75
75
body : JSON . stringify ( { jwt : jwtToken } )
76
76
} ) ;
77
77
if ( ! response . ok ) {
78
- await _chunkOLZEGNJMjs . throwHttpErrorMessage . call ( void 0 ,
78
+ await _chunk1js . throwHttpErrorMessage . call ( void 0 ,
79
79
"Failed to retrieve token from Cargo registry" ,
80
80
response
81
81
) ;
82
82
}
83
83
const tokenResponse = await response . json ( ) ;
84
84
if ( ! tokenResponse . token ) {
85
- await _chunkOLZEGNJMjs . throwHttpErrorMessage . call ( void 0 ,
85
+ await _chunk1js . throwHttpErrorMessage . call ( void 0 ,
86
86
"Failed to retrieve token from the Cargo registry response body" ,
87
87
response
88
88
) ;
@@ -92,7 +92,7 @@ async function requestTrustedPublishingToken(registryUrl, jwtToken) {
92
92
}
93
93
function setTokenOutput ( token ) {
94
94
core2 . setSecret ( token ) ;
95
- core2 . setOutput ( _chunkOLZEGNJMjs . TOKEN_KEY , token ) ;
95
+ core2 . setOutput ( _chunk1js . TOKEN_KEY , token ) ;
96
96
}
97
97
98
98
0 commit comments