Skip to content

Commit

Permalink
chore(ci): verify autorelease release PR content has changes (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaniewang526 committed Sep 24, 2020
1 parent 95dbe1b commit da29da3
Showing 1 changed file with 18 additions and 0 deletions.
Expand Up @@ -21,6 +21,24 @@ jobs:
return;
}
// only approve PRs with pom.xml and versions.txt changes
const filesPromise = github.pulls.listFiles.endpoint({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
const changed_files = await github.paginate(filesPromise)
if ( changed_files.length < 1 ) {
console.log( "Not proceeding since PR is empty!" )
return;
}
if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) {
console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" )
return;
}
// trigger auto-release when
// 1) it is a SNAPSHOT release (auto-generated post regular release)
// 2) there are dependency updates only
Expand Down

0 comments on commit da29da3

Please sign in to comment.