Skip to content

Commit

Permalink
fix: bug not using the path for source file inputs (#1179)
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 committed May 26, 2023
1 parent e82d391 commit c798a4e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 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.

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

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/main.ts
Expand Up @@ -94,7 +94,8 @@ export async function run(): Promise<void> {
)

const filePatterns = await getFilePatterns({
inputs
inputs,
workingDirectory
})

const addedFiles = await getDiffFiles({
Expand Down
6 changes: 5 additions & 1 deletion src/utils.ts
Expand Up @@ -676,9 +676,11 @@ export const jsonOutput = ({
}

export const getFilePatterns = async ({
inputs
inputs,
workingDirectory
}: {
inputs: Inputs
workingDirectory: string
}): Promise<string[]> => {
let filePatterns = inputs.files
.split(inputs.filesSeparator)
Expand All @@ -689,6 +691,7 @@ export const getFilePatterns = async ({
const inputFilesFromSourceFile = inputs.filesFromSourceFile
.split(inputs.filesFromSourceFileSeparator)
.filter(p => p !== '')
.map(p => path.join(workingDirectory, p))

core.debug(`files from source file: ${inputFilesFromSourceFile}`)

Expand Down Expand Up @@ -722,6 +725,7 @@ export const getFilePatterns = async ({
const inputFilesIgnoreFromSourceFile = inputs.filesIgnoreFromSourceFile
.split(inputs.filesIgnoreFromSourceFileSeparator)
.filter(p => p !== '')
.map(p => path.join(workingDirectory, p))

core.debug(
`files ignore from source file: ${inputFilesIgnoreFromSourceFile}`
Expand Down

0 comments on commit c798a4e

Please sign in to comment.