@adobe/helix-admin-support 2.0.0 → 2.0.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.0.1](https://github.com/adobe/helix-admin-support/compare/v2.0.0...v2.0.1) (2023-04-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * regression - load fstab from github ([#131](https://github.com/adobe/helix-admin-support/issues/131)) ([389a0be](https://github.com/adobe/helix-admin-support/commit/389a0bef218ae299c3dd83fd30f190ab9cce64fe))
7
+
1
8
  # [2.0.0](https://github.com/adobe/helix-admin-support/compare/v1.6.37...v2.0.0) (2023-04-03)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-admin-support",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Helix Admin Support Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -12,6 +12,7 @@
12
12
  import { logLevelForStatusCode, propagateStatusCode } from '@adobe/helix-shared-utils';
13
13
  import { MountConfig } from '@adobe/helix-shared-config';
14
14
  import { fetchS3 } from './fetch-s3.js';
15
+ import { fetch } from './utils.js';
15
16
 
16
17
  /**
17
18
  * Checks if the response is valid and returns a mount config.
@@ -56,9 +57,24 @@ export async function fetchFstab(ctx, opts, optional) {
56
57
  return null;
57
58
  }
58
59
 
59
- const key = `${owner}/${repo}/main/fstab.yaml`;
60
- const response = await fetchS3(ctx, 'helix-code-bus', key);
61
- return handleResponse(log, response, key, 'code-bus');
60
+ let key = `${owner}/${repo}/main/fstab.yaml`;
61
+ let response = await fetchS3(ctx, 'helix-code-bus', key);
62
+ const cfg = await handleResponse(log, response, key, 'code-bus');
63
+ if (cfg) {
64
+ return cfg;
65
+ }
66
+
67
+ // try loading from github for non helix-3 repos
68
+ const headers = {};
69
+ key = `${owner}/${repo}/main/fstab.yaml`;
70
+ if (ctx.githubToken) {
71
+ headers.authorization = `token ${ctx.githubToken}`;
72
+ }
73
+ response = await fetch(`https://raw.githubusercontent.com/${key}`, {
74
+ cache: 'no-store',
75
+ headers,
76
+ });
77
+ return handleResponse(log, response, key, 'github');
62
78
  };
63
79
 
64
80
  if (!('mountConfig' in attributes)) {