@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.
Files changed (2) hide show
  1. package/dist/index.mjs +8 -6
  2. 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 getBearerToken({ token, ciProvider, owner, repository, jobId, runId, prNumber }) {
686
- if (token) return `Bearer ${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 `Bearer tokenless-github-${base64Encode({
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 = getBearerToken(config);
836
+ const authToken = getAuthToken(config);
835
837
  const apiClient = createClient({
836
838
  baseUrl: config.apiBaseUrl,
837
- authToken: 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+4b6e8a3",
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.32+4b6e8a3",
44
- "@argos-ci/util": "2.1.1-alpha.12+4b6e8a3",
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": "4b6e8a36627d466e65859396ec6cfee717ba7c7b"
63
+ "gitHead": "6b6c15f62882eb38e36a59f80f5ad2aa6d7ee3ff"
64
64
  }