@backstage/integration 1.4.2 → 1.4.3-next.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.esm.js CHANGED
@@ -1179,7 +1179,9 @@ function readGithubIntegrationConfigs(configs) {
1179
1179
  function getGithubFileFetchUrl(url, config, credentials) {
1180
1180
  try {
1181
1181
  const { owner, name, ref, filepathtype, filepath } = parseGitUrl(url);
1182
- if (!owner || !name || !ref || filepathtype !== "blob" && filepathtype !== "raw" && filepathtype !== "tree") {
1182
+ if (!owner || !name || !ref || // GitHub is automatically redirecting tree urls to blob urls so it's
1183
+ // fine to pass a tree url.
1184
+ filepathtype !== "blob" && filepathtype !== "raw" && filepathtype !== "tree") {
1183
1185
  throw new Error("Invalid GitHub URL or file path");
1184
1186
  }
1185
1187
  const pathWithoutSlash = filepath.replace(/^\//, "");