// If we want to backport this to the current branch, the backlog entry should only exist in the ./.changes/current directory
if (currentBackportLabel) {
if (devChangesPresent) {
await createOrUpdateChangelogComment("Please move the changelog entry from `./.changes/dev` to `./.changes/current` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
if (nextChangesPresent) {
await createOrUpdateChangelogComment("Please move the changelog entry from `./.changes/next` to `./.changes/current` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
if (!currentChangesPresent) {
await createOrUpdateChangelogComment("Please add a changelog entry to `./.changes/current` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
// If we have no current backport label, but a next backport label we should only have a changelog entry in the ./.changes/next directory
}else if (nextBackportLabel) {
if (devChangesPresent) {
await createOrUpdateChangelogComment("Please move the changelog entry from `./.changes/dev` to `./.changes/next` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
if (currentChangesPresent) {
await createOrUpdateChangelogComment("Please move the changelog entry from `./.changes/current` to `./.changes/next` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
if (!nextChangesPresent) {
await createOrUpdateChangelogComment("Please add a changelog entry to `./.changes/next` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
// If we don't have a backport label we only expect changes in the ./.changes/dev directory
}else {
if (nextChangesPresent) {
await createOrUpdateChangelogComment("Please move the changelog entry from `./.changes/next` to `./.changes/dev` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
if (currentChangesPresent) {
await createOrUpdateChangelogComment("Please move the changelog entry from `./.changes/current` to `./.changes/dev` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
if (missingChangelogEntry) {
await createOrUpdateChangelogComment(`Please add a changelog entry for in the .changes/v${onlyExpectedChangeVersion} folder. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.`);
return;
}
if (!devChangesPresent) {
await createOrUpdateChangelogComment("Please add a changelog entry to `./.changes/dev` for this change. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.");
return;
}
if (unexpectedChangelogEntry.length > 0) {
await createOrUpdateChangelogComment(`Please remove the changelog entry for the following paths:${unexpectedChangelogEntry.join(", ")}. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.`);
return;
}
// Nothing to complain about, so delete any existing comment