Skip to content

Commit

Permalink
chore(ci): verify autorelease release PR content has changes (#157)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/4d7892ee-6265-4e89-b8a8-1c509f6b7076/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@da29da3
  • Loading branch information
yoshi-automation authored Sep 26, 2020
1 parent 87c9cc3 commit 2c2b499
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions java-shared-dependencies/.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 java-shared-dependencies/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-shared-dependencies.git",
"sha": "79946122e194c67eac609e42ef73917c59c12daa"
"sha": "65fb72633254d79d47be4fb621856bc0b7a6a87a"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "95dbe1bee3c7f7e52ddb24a54c37080620e0d1a2"
"sha": "da29da32b3a988457b49ae290112b74f14b713cc"
}
}
],
Expand Down

0 comments on commit 2c2b499

Please sign in to comment.