Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

chore(ci): verify autorelease release PR content has changes #142

Merged
merged 1 commit into from
Sep 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-bigqueryconnection.git",
"sha": "7753891e1a94be5bee835cd20bfb1e4b840c7853"
"sha": "0edf9b71b80492fe29440f01a71d3f80780a3809"
}
},
{
Expand All @@ -27,7 +27,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "95dbe1bee3c7f7e52ddb24a54c37080620e0d1a2"
"sha": "da29da32b3a988457b49ae290112b74f14b713cc"
}
}
],
Expand Down