@argos-ci/core 2.2.1-alpha.7 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +6 -12
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -491,11 +491,6 @@ const schema = {
|
|
|
491
491
|
default: null,
|
|
492
492
|
nullable: true
|
|
493
493
|
},
|
|
494
|
-
ciService: {
|
|
495
|
-
format: String,
|
|
496
|
-
default: null,
|
|
497
|
-
nullable: true
|
|
498
|
-
},
|
|
499
494
|
jobId: {
|
|
500
495
|
format: String,
|
|
501
496
|
default: null,
|
|
@@ -507,7 +502,7 @@ const schema = {
|
|
|
507
502
|
nullable: true
|
|
508
503
|
},
|
|
509
504
|
runAttempt: {
|
|
510
|
-
format:
|
|
505
|
+
format: "nat",
|
|
511
506
|
default: null,
|
|
512
507
|
nullable: true
|
|
513
508
|
},
|
|
@@ -545,7 +540,6 @@ async function readConfig(options = {}) {
|
|
|
545
540
|
prHeadCommit: config.get("prHeadCommit") || ciEnv?.prHeadCommit || null,
|
|
546
541
|
referenceBranch: options.referenceBranch || config.get("referenceBranch") || null,
|
|
547
542
|
referenceCommit: options.referenceCommit || config.get("referenceCommit") || null,
|
|
548
|
-
ciService: ciEnv?.name || null,
|
|
549
543
|
owner: ciEnv?.owner || null,
|
|
550
544
|
repository: ciEnv?.repository || null,
|
|
551
545
|
jobId: ciEnv?.jobId || null,
|
|
@@ -611,13 +605,13 @@ const hashFile = async (filepath)=>{
|
|
|
611
605
|
};
|
|
612
606
|
|
|
613
607
|
const base64Encode = (obj)=>Buffer.from(JSON.stringify(obj), "utf8").toString("base64");
|
|
614
|
-
|
|
608
|
+
function getBearerToken({ token, ciProvider, owner, repository, jobId, runId, prNumber }) {
|
|
615
609
|
if (token) return `Bearer ${token}`;
|
|
616
|
-
switch(
|
|
617
|
-
case "
|
|
610
|
+
switch(ciProvider){
|
|
611
|
+
case "github-actions":
|
|
618
612
|
{
|
|
619
613
|
if (!owner || !repository || !jobId || !runId) {
|
|
620
|
-
throw new Error(`Automatic
|
|
614
|
+
throw new Error(`Automatic GitHub Actions variables detection failed. Please add the 'ARGOS_TOKEN'`);
|
|
621
615
|
}
|
|
622
616
|
return `Bearer tokenless-github-${base64Encode({
|
|
623
617
|
owner,
|
|
@@ -630,7 +624,7 @@ const getBearerToken = ({ token, ciService, owner, repository, jobId, runId, prN
|
|
|
630
624
|
default:
|
|
631
625
|
throw new Error("Missing Argos repository token 'ARGOS_TOKEN'");
|
|
632
626
|
}
|
|
633
|
-
}
|
|
627
|
+
}
|
|
634
628
|
const createArgosApiClient = (options)=>{
|
|
635
629
|
const axiosInstance = axios.create({
|
|
636
630
|
baseURL: options.baseUrl,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/core",
|
|
3
3
|
"description": "Visual testing solution to avoid visual regression. The core component of Argos SDK that handles build creation.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"build": "rollup -c",
|
|
60
60
|
"e2e": "node ./e2e/upload.cjs && node ./e2e/upload.mjs"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "0c328bfcd6475ad625c0335cab11e912e856173c"
|
|
63
63
|
}
|