Skip to content

Commit 6d7310f

Browse files
add GH action to update submodule
1 parent e66efab commit 6d7310f

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.github/workflows/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ _Action:_ Build the Java Client Library and runs [the system tests](https://gith
130130

131131
_Recovery:_ Manually trigger the action on the desired branch.
132132

133+
### update-jmxfetch-submodule [🔗](update-jmxfetch-submodule.yaml)
134+
135+
_Trigger:_ Monthly or manually
136+
137+
_Action:_ Creates a PR updating the git submodule at dd-java-agent/agent-jmxfetch/integrations-core
138+
139+
_Recovery:_ Manually trigger the action again.
140+
133141
## Maintenance
134142

135143
GitHub actions should be part of the [repository allowed actions to run](https://github.com/DataDog/dd-trace-java/settings/actions).
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Update Docker Build Image
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 1 * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
14+
with:
15+
submodules: 'recursive'
16+
fetch-depth: 0
17+
18+
- name: Cache Gradle dependencies
19+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
20+
with:
21+
path: |
22+
~/.gradle/caches
23+
~/.gradle/wrapper
24+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
25+
restore-keys: |
26+
${{ runner.os }}-gradle-
27+
28+
- name: Update Submodule
29+
run: |
30+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
31+
JAVA_HOME=$JAVA_HOME_8_X64 \
32+
JAVA_8_HOME=$JAVA_HOME_8_X64 \
33+
JAVA_11_HOME=$JAVA_HOME_11_X64 \
34+
JAVA_17_HOME=$JAVA_HOME_17_X64 \
35+
JAVA_21_HOME=$JAVA_HOME_21_X64 \
36+
./gradlew :dd-java-agent:agent-jmxfetch:submodulesUpdate
37+
- name: Download ghcommit CLI
38+
run: |
39+
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
40+
chmod +x /usr/local/bin/ghcommit
41+
- name: Pick a branch name
42+
id: define-branch
43+
run: echo "branch=ci/update-jmxfetch-submodule-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
44+
- name: Create branch
45+
run: |
46+
git checkout -b ${{ steps.define-branch.outputs.branch }}
47+
git push -u origin ${{ steps.define-branch.outputs.branch }} --force
48+
- name: Commit and push changes
49+
env:
50+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
51+
run: |
52+
ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add dd-java-agent/agent-jmxfetch/integrations-core --message "Update agent-jmxfetch submodule"
53+
- name: Create pull request
54+
env:
55+
GH_TOKEN: ${{ github.token }}
56+
run: |
57+
gh pr create --title "Update agent-jmxfetch submodule" \
58+
--base master \
59+
--head ${{ steps.define-branch.outputs.branch }} \
60+
--label "comp: tooling" \
61+
--label "type: enhancement" \
62+
--label "tag: no release notes" \
63+
--body "This PR updates the agent-jmxfetch submodule."

0 commit comments

Comments
 (0)