Skip to content

Commit

Permalink
fix: bug with only_(changed|modified|deleted) outputs (#1238)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
jackton1 and actions-user authored Jun 7, 2023
1 parent a522bdb commit 6dc4095
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
12 changes: 9 additions & 3 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ export async function run(): Promise<void> {
)

const onlyChanged =
otherChangedFiles.length === 0 && allChangedFiles.length > 0
otherChangedFiles.length === 0 &&
allChangedFiles.length > 0 &&
filePatterns.length > 0

await setOutput({
key: 'only_changed',
Expand Down Expand Up @@ -323,7 +325,9 @@ export async function run(): Promise<void> {
)

const onlyModified =
otherModifiedFiles.length === 0 && allModifiedFiles.length > 0
otherModifiedFiles.length === 0 &&
allModifiedFiles.length > 0 &&
filePatterns.length > 0

await setOutput({
key: 'only_modified',
Expand Down Expand Up @@ -374,7 +378,10 @@ export async function run(): Promise<void> {
filePath => !deletedFiles.split(inputs.separator).includes(filePath)
)

const onlyDeleted = otherDeletedFiles.length === 0 && deletedFiles.length > 0
const onlyDeleted =
otherDeletedFiles.length === 0 &&
deletedFiles.length > 0 &&
filePatterns.length > 0

await setOutput({
key: 'only_deleted',
Expand Down

0 comments on commit 6dc4095

Please sign in to comment.