Skip to content

changelog-enforcer: add a more detailed information about updating chagnelog #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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