@argos-ci/core 2.4.2-alpha.4 → 2.4.2-alpha.6
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 +8 -6
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -682,15 +682,17 @@ const hashFile = async (filepath)=>{
|
|
|
682
682
|
};
|
|
683
683
|
|
|
684
684
|
const base64Encode = (obj)=>Buffer.from(JSON.stringify(obj), "utf8").toString("base64");
|
|
685
|
-
function
|
|
686
|
-
if (token)
|
|
685
|
+
function getAuthToken({ token, ciProvider, owner, repository, jobId, runId, prNumber }) {
|
|
686
|
+
if (token) {
|
|
687
|
+
return token;
|
|
688
|
+
}
|
|
687
689
|
switch(ciProvider){
|
|
688
690
|
case "github-actions":
|
|
689
691
|
{
|
|
690
692
|
if (!owner || !repository || !jobId || !runId) {
|
|
691
693
|
throw new Error(`Automatic GitHub Actions variables detection failed. Please add the 'ARGOS_TOKEN'`);
|
|
692
694
|
}
|
|
693
|
-
return `
|
|
695
|
+
return `tokenless-github-${base64Encode({
|
|
694
696
|
owner,
|
|
695
697
|
repository,
|
|
696
698
|
jobId,
|
|
@@ -831,14 +833,14 @@ async function uploadFilesToS3(files) {
|
|
|
831
833
|
"**/*.{png,jpg,jpeg}"
|
|
832
834
|
];
|
|
833
835
|
debug("Using config and files", config, files);
|
|
834
|
-
const authToken =
|
|
836
|
+
const authToken = getAuthToken(config);
|
|
835
837
|
const apiClient = createClient({
|
|
836
838
|
baseUrl: config.apiBaseUrl,
|
|
837
|
-
authToken
|
|
839
|
+
authToken
|
|
838
840
|
});
|
|
839
841
|
const legacyApiClient = createArgosLegacyAPIClient({
|
|
840
842
|
baseUrl: config.apiBaseUrl,
|
|
841
|
-
bearerToken: authToken
|
|
843
|
+
bearerToken: `Bearer ${authToken}`
|
|
842
844
|
});
|
|
843
845
|
// Collect screenshots
|
|
844
846
|
const foundScreenshots = await discoverScreenshots(files, {
|
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.2-alpha.
|
|
4
|
+
"version": "2.4.2-alpha.6+6b6c15f",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@argos-ci/api-client": "0.1.1-alpha.
|
|
44
|
-
"@argos-ci/util": "2.1.1-alpha.
|
|
43
|
+
"@argos-ci/api-client": "0.1.1-alpha.34+6b6c15f",
|
|
44
|
+
"@argos-ci/util": "2.1.1-alpha.14+6b6c15f",
|
|
45
45
|
"axios": "^1.7.4",
|
|
46
46
|
"convict": "^6.2.4",
|
|
47
47
|
"debug": "^4.3.6",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"build": "rollup -c",
|
|
61
61
|
"e2e": "node ./e2e/upload.cjs && node ./e2e/upload.mjs"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "6b6c15f62882eb38e36a59f80f5ad2aa6d7ee3ff"
|
|
64
64
|
}
|