Skip to content

Commit

Permalink
Add renamed modified files to modified
Browse files Browse the repository at this point in the history
Rename files have the status `renamed`, but they can be also be
modified. In this case, they include a patch field with the change. Use
this field and add renamed files that have been modified to `modified`
and `added_modified`.
  • Loading branch information
Ana06 committed Dec 21, 2021
1 parent 80bcab9 commit 47aa8c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4617,6 +4617,10 @@ function run() {
break;
case 'renamed':
renamed.push(filename);
if (file.patch) { // modified renamed files include a patch field
modified.push(filename);
addedModified.push(filename);
}
break;
default:
core.setFailed(`One of your files includes an unsupported file status '${file.status}', expected 'added', 'modified', 'removed', or 'renamed'.`);
Expand Down
5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ async function run(): Promise<void> {
break
case 'renamed':
renamed.push(filename)
if (file.patch) {
// modified renamed files include a patch field
modified.push(filename)
addedModified.push(filename)
}
break
default:
core.setFailed(
Expand Down

0 comments on commit 47aa8c6

Please sign in to comment.