Skip to content

Commit

Permalink
fix: Fix temp env only being included for the labeled event
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Jun 27, 2024
1 parent c497bc1 commit b3ab63a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ try {
if (github.context.eventName === "pull_request") {
const prEvent = github.context.payload;
const targetLabel = value.label || prEvent.label?.name;
if (
prEvent.action === "labeled" &&
prEvent.label.name === targetLabel
) {
const hasLabel =
(prEvent.action === "labeled" &&
prEvent.label.name === targetLabel) ||
prEvent.pull_request.labels.some(
(label) => label.name === targetLabel,
);
if (hasLabel) {
patterns = ref;
value.name = `${value.name || toTitleCase(env)} #${prEvent.number}`;
env += prEvent.number;
Expand Down

0 comments on commit b3ab63a

Please sign in to comment.