Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions changelog-enforcer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = async ({ github, context, core, custom_paths }) => {
return;
}

let files = [];
const files = [];
for await (const response of github.paginate.iterator(
github.rest.pulls.listFiles,
{
Expand All @@ -29,9 +29,9 @@ module.exports = async ({ github, context, core, custom_paths }) => {
}
console.log("Files changed in the PR: " + files.length);

let extensions = new Set();
let missingChangelogs = [];
let caseMismatchChangelogs = [];
const extensions = new Set();
const missingChangelogs = [];
const caseMismatchChangelogs = [];
files.forEach((file) => {
const parts = file.filename.split("/");
if (parts.length > 2 && parts[0] === "extensions") {
Expand All @@ -43,7 +43,7 @@ module.exports = async ({ github, context, core, custom_paths }) => {
console.log(`- ${extension}`);
});

let changelogFileName = "CHANGELOG.md";
const changelogFileName = "CHANGELOG.md";
extensions.forEach((extension) => {
const changelogPath = `extensions/${extension}/${changelogFileName}`;
const changelogExists = files.some(
Expand Down Expand Up @@ -71,7 +71,7 @@ module.exports = async ({ github, context, core, custom_paths }) => {
core.setFailed(
`Missing ${changelogFileName} update for extensions: ${missingChangelogs.join(
", "
)}`
)}. See https://developers.raycast.com/basics/contribute-to-an-extension#develop-the-extension to learn how to update the changelog.`
);
}
} catch (error) {
Expand Down