From da2651947a03017769db307636f3c8ce99fb409c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 25 Sep 2020 17:36:07 -0700 Subject: [PATCH] chore(ci): verify autorelease release PR content has changes (#142) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/89edc375-a9b4-4f10-8e55-8b2c913e0f61/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/da29da32b3a988457b49ae290112b74f14b713cc --- .github/workflows/auto-release.yaml | 18 ++++++++++++++++++ synth.metadata | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 3ce51eee..bc1554ae 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -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 diff --git a/synth.metadata b/synth.metadata index 269d3a87..cfb26293 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigqueryconnection.git", - "sha": "7753891e1a94be5bee835cd20bfb1e4b840c7853" + "sha": "0edf9b71b80492fe29440f01a71d3f80780a3809" } }, { @@ -27,7 +27,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "95dbe1bee3c7f7e52ddb24a54c37080620e0d1a2" + "sha": "da29da32b3a988457b49ae290112b74f14b713cc" } } ],