Skip to content

Commit

Permalink
Merge pull request #142 from gentlementlegen/development
Browse files Browse the repository at this point in the history
fix(push-event): handle changes to both dev and prod config
  • Loading branch information
gentlementlegen authored Oct 12, 2024
2 parents 7841107 + 9435e12 commit b927790
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/github/handlers/push-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ValueError } from "typebox-validators";
import YAML, { LineCounter, Node, YAMLError } from "yaml";
import { GitHubContext } from "../github-context";
import { configSchema, PluginConfiguration } from "../types/plugin-configuration";
import { CONFIG_FULL_PATH, getConfigurationFromRepo } from "../utils/config";
import { CONFIG_FULL_PATH, DEV_CONFIG_FULL_PATH, getConfigurationFromRepo } from "../utils/config";
import { getManifest } from "../utils/plugins";

function constructErrorBody(
Expand Down Expand Up @@ -124,8 +124,8 @@ async function checkPluginConfigurations(context: GitHubContext<"push">, config:
export default async function handlePushEvent(context: GitHubContext<"push">) {
const { payload } = context;
const { repository, commits, after } = payload;

const didConfigurationFileChange = commits.some((commit) => commit.modified?.includes(CONFIG_FULL_PATH) || commit.added?.includes(CONFIG_FULL_PATH));
const configPaths = [CONFIG_FULL_PATH, DEV_CONFIG_FULL_PATH];
const didConfigurationFileChange = commits.some((commit) => configPaths.some((path) => commit.modified?.includes(path) || commit.added?.includes(path)));

if (!didConfigurationFileChange || !repository.owner) {
return;
Expand Down

0 comments on commit b927790

Please sign in to comment.