Skip to content

Commit

Permalink
fix: add ignore alias to add resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaagrav committed Nov 2, 2023
1 parent 8f8b50a commit 08f6613
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/set-resource-on-asset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getAsset, createResource, getDownstreamAssets } from "../api/index.js";
import { isIgnoreModelAliasMatching } from "../utils/get-environment-variables.js";
import {
createIssueComment,
getChangedFiles,
Expand All @@ -23,12 +24,13 @@ export default async function setResourceOnAsset({ octokit, context }) {
).length;

for (const { fileName, filePath } of changedFiles) {
const assetName = await getAssetName({
const aliasName = await getAssetName({
octokit,
context,
fileName,
filePath,
});
const assetName = isIgnoreModelAliasMatching() ? fileName : aliasName;
const asset = await getAsset({ name: assetName });

if (asset.error) continue;
Expand Down Expand Up @@ -66,7 +68,7 @@ export default async function setResourceOnAsset({ octokit, context }) {
const { guid: tableAssetGuid } = materialisedView
const resp = await createResource(
tableAssetGuid,
"Pull Request on GitHub",
pull_request.title,
pull_request.html_url
);
const md = `${getConnectorImage(materialisedView.attributes.connectorName)} [${
Expand Down

0 comments on commit 08f6613

Please sign in to comment.