Skip to content

Commit

Permalink
fix: bug with returning old filename in renamed files output (#1281)
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 Jun 19, 2023
1 parent 6d89069 commit 54479c3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -1048,6 +1048,13 @@ jobs:
exit 1
shell:
bash
- name: Check the renamed_files output
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt')"
run: |
echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})"
exit 1
shell:
bash
- name: Run changed-files for old new filenames test rename 2
id: changed-files-all-old-new-renamed-files-2
uses: ./
Expand All @@ -1068,6 +1075,13 @@ jobs:
exit 1
shell:
bash
- name: Check the renamed_files output
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt')"
run: |
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})"
exit 1
shell:
bash
- name: Run changed-files for old new filenames test rename 2 output as deleted and added
id: changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added
uses: ./
Expand Down
2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion src/utils.ts
Expand Up @@ -484,7 +484,7 @@ export const getAllChangedFiles = async ({
changedFiles[ChangeTypeEnum.Deleted].push(normalizedFilePath)
changedFiles[ChangeTypeEnum.Added].push(normalizedNewPath)
} else {
changedFiles[ChangeTypeEnum.Renamed].push(normalizedFilePath)
changedFiles[ChangeTypeEnum.Renamed].push(normalizedNewPath)
}
} else {
changedFiles[changeType as ChangeTypeEnum].push(normalizedFilePath)
Expand Down

0 comments on commit 54479c3

Please sign in to comment.