Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit a8aae5b

Browse files
chore: regenerate common templates (#37)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/57f648af-3d64-4336-ade9-f6f77c7ec353/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@7c53709 Source-Link: googleapis/synthtool@27e0e91
1 parent bc392c2 commit a8aae5b

File tree

3 files changed

+66
-4
lines changed

3 files changed

+66
-4
lines changed

.github/workflows/approve-readme.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on:
2+
pull_request:
3+
name: auto-merge-readme
4+
jobs:
5+
approve:
6+
runs-on: ubuntu-latest
7+
if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme'
8+
steps:
9+
- uses: actions/github-script@v3.0.0
10+
with:
11+
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
12+
script: |
13+
// only approve PRs from yoshi-automation
14+
if (context.payload.pull_request.user.login !== "yoshi-automation") {
15+
return;
16+
}
17+
18+
// only approve PRs like "chore: release <release version>"
19+
if (!context.payload.pull_request.title === "chore: regenerate README") {
20+
return;
21+
}
22+
23+
// only approve PRs with README.md and synth.metadata changes
24+
const files = new Set(
25+
(
26+
await github.paginate(
27+
github.pulls.listFiles.endpoint({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
pull_number: context.payload.pull_request.number,
31+
})
32+
)
33+
).map(file => file.filename)
34+
);
35+
if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) {
36+
return;
37+
}
38+
39+
// approve README regeneration PR
40+
await github.pulls.createReview({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
body: 'Rubber stamped PR!',
44+
pull_number: context.payload.pull_request.number,
45+
event: 'APPROVE'
46+
});
47+
48+
// attach automerge label
49+
await github.issues.addLabels({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
issue_number: context.payload.pull_request.number,
53+
labels: ['automerge']
54+
});

.kokoro/build.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,16 @@ integration)
6969
RETURN_CODE=$?
7070
;;
7171
samples)
72-
if [[ -f samples/pom.xml ]]
72+
SAMPLES_DIR=samples
73+
# only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise.
74+
if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]]
7375
then
74-
pushd samples
76+
SAMPLES_DIR=samples/snapshot
77+
fi
78+
79+
if [[ -f ${SAMPLES_DIR}/pom.xml ]]
80+
then
81+
pushd {SAMPLES_DIR}
7582
mvn -B \
7683
-Penable-samples \
7784
-DtrimStackTrace=false \

synth.metadata

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-video-transcoder.git",
7-
"sha": "3faa3a3723de1b8623e380d854d96bd124dddc2e"
7+
"sha": "c03b3b106432898d74b3bb2165e753fe2632a168"
88
}
99
},
1010
{
@@ -19,7 +19,7 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "b65ef07d99946d23e900ef2cc490274a16edd336"
22+
"sha": "7c5370937dd9ba9dcf9cd7d2af880a58b389b4f1"
2323
}
2424
}
2525
],
@@ -43,6 +43,7 @@
4343
".github/readme/synth.py",
4444
".github/release-please.yml",
4545
".github/trusted-contribution.yml",
46+
".github/workflows/approve-readme.yaml",
4647
".github/workflows/auto-release.yaml",
4748
".github/workflows/ci.yaml",
4849
".github/workflows/formatting.yaml",

0 commit comments

Comments
 (0)