-
Notifications
You must be signed in to change notification settings - Fork 372
Expand file tree
/
Copy pathanalyze-releases-for-adk-docs-updates.yml
More file actions
85 lines (79 loc) · 2.99 KB
/
Copy pathanalyze-releases-for-adk-docs-updates.yml
File metadata and controls
85 lines (79 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Analyze New Release for ADK Docs Updates
on:
# Runs on every new release.
release:
types: [published]
# Manual trigger for testing and retrying.
workflow_dispatch:
inputs:
start_tag:
description: 'Older release tag (base), e.g. v0.1.0'
required: false
type: string
end_tag:
description: 'Newer release tag (head), e.g. v0.2.0'
required: false
type: string
dry_run:
description: 'Dry run: preview only. Set to false to actually create the issue and PRs.'
required: false
default: true
type: boolean
jobs:
analyze-new-release-for-adk-docs-updates:
runs-on: ubuntu-latest
# Dry-run reads only (this repo + the public docs repo) and skips writes, so
# the built-in GITHUB_TOKEN suffices. For --no-dry-run, use a PAT with write
# access to the docs repo.
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run the ADK Docs Release Analyzer
env:
# Built-in token is enough for dry-run (read-only). For --no-dry-run, use a
# PAT with docs-repo write access, e.g. ${{ secrets.ADK_TRIAGE_AGENT }}.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GOOGLE_GENAI_USE_VERTEXAI: '0'
DOC_OWNER: 'google'
CODE_OWNER: 'google'
DOC_REPO: 'adk-docs'
CODE_REPO: 'adk-java'
ANALYZER_START_TAG: ${{ github.event.inputs.start_tag }}
ANALYZER_END_TAG: ${{ github.event.inputs.end_tag }}
# Defaults to dry-run (preview only). Flip to false via manual dispatch
# to actually create the issue and PRs.
ANALYZER_DRY_RUN: ${{ github.event.inputs.dry_run || 'true' }}
shell: bash
run: |
set -euo pipefail
if [[ "${ANALYZER_DRY_RUN}" == "false" ]]; then
args="--no-dry-run"
else
args="--dry-run"
fi
if [[ -n "${ANALYZER_START_TAG:-}" ]]; then
args="${args} --start-tag ${ANALYZER_START_TAG}"
fi
if [[ -n "${ANALYZER_END_TAG:-}" ]]; then
args="${args} --end-tag ${ANALYZER_END_TAG}"
fi
# Install ADK libs + sample, then run exec:java scoped to this module
# (exec:java with -am would also run on the parent, which has no mainClass).
./mvnw -B -q -pl contrib/samples/github/adkreleasedocs -am install -DskipTests
./mvnw -B -q -pl contrib/samples/github/adkreleasedocs exec:java \
-Dexec.args="${args}"