Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
noahp committed Aug 10, 2023
1 parent bc3a3f7 commit 558c3cc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/detect-renamed-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ function updateRedirects(originalName, newName) {
fs.writeFileSync(redirectsFilePath, updatedRedirects, 'utf-8');
}

const changedFiles = JSON.parse(process.env.GITHUB_EVENT_PATH).commits[0].added.concat(
JSON.parse(process.env.GITHUB_EVENT_PATH).commits[0].modified
);
const gh_json = JSON.parse(process.env.GITHUB_EVENT_PATH)
console.log(changedFiles);
const addedFiles = gh_json.commits[0].added;
console.log(addedFiles);
const modifiedFiles = gh_json.commits[0].modified;
console.log(modifiedFiles);
const changedFiles = addedFiles.concat(modifiedFiles);
console.log(changedFiles);

changedFiles.forEach(file => {
if (file.startsWith('_posts/')) {
Expand Down

0 comments on commit 558c3cc

Please sign in to comment.