Skip to content

Commit e8a8c39

Browse files
committed
Read package name from package.json file too
1 parent cfe14cd commit e8a8c39

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

dist/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19933,8 +19933,9 @@ function getTokensEndpoint(registryUrl) {
1993319933
return `${registryUrl}/api/v1/trusted_publishing/tokens`;
1993419934
}
1993519935
function userAgentValue() {
19936+
const packageName = package_default.name;
1993619937
const packageVersion = package_default.version;
19937-
return `crates-io-auth-action/${packageVersion}`;
19938+
return `${packageName}/${packageVersion}`;
1993819939
}
1993919940
function getUserAgent() {
1994019941
const userAgent = userAgentValue();

dist/post.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19914,8 +19914,9 @@ function getTokensEndpoint(registryUrl) {
1991419914
return `${registryUrl}/api/v1/trusted_publishing/tokens`;
1991519915
}
1991619916
function userAgentValue() {
19917+
const packageName = package_default.name;
1991719918
const packageVersion = package_default.version;
19918-
return `crates-io-auth-action/${packageVersion}`;
19919+
return `${packageName}/${packageVersion}`;
1991919920
}
1992019921
function getUserAgent() {
1992119922
const userAgent = userAgentValue();

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ export function getTokensEndpoint(registryUrl: string): string {
7878
}
7979

8080
function userAgentValue(): string {
81+
const packageName: string = packageJson.name;
8182
const packageVersion: string = packageJson.version;
82-
return `crates-io-auth-action/${packageVersion}`;
83+
return `${packageName}/${packageVersion}`;
8384
}
8485

8586
export function getUserAgent(): UserAgent {

0 commit comments

Comments
 (0)