Update jmxfetch integrations submodule #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update jmxfetch integrations submodule | |
| on: | |
| schedule: | |
| - cron: '0 0 1 * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC token federation | |
| steps: | |
| - uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3 | |
| id: octo-sts | |
| with: | |
| scope: DataDog/dd-trace-java | |
| policy: self.update-jmxfetch-submodule.create-pr | |
| - name: Checkout repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0 | |
| - name: Update Submodule | |
| run: | | |
| git submodule update --remote -- dd-java-agent/agent-jmxfetch/integrations-core | |
| - name: Check if changes should be committed | |
| id: check-changes | |
| run: | | |
| if [[ -z "$(git status -s)" ]]; then | |
| echo "No changes to commit, exiting." | |
| echo "commit_changes=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| else | |
| echo "commit_changes=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Pick a branch name | |
| if: steps.check-changes.outputs.commit_changes == 'true' | |
| id: define-branch | |
| run: echo "branch=ci/update-jmxfetch-submodule-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
| - name: Commit changes | |
| if: steps.check-changes.outputs.commit_changes == 'true' | |
| id: create-commit | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git commit -m "feat(ci): Update agent-jmxfetch submodule" dd-java-agent/agent-jmxfetch/integrations-core | |
| echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Push changes | |
| uses: DataDog/commit-headless@1186485b788f57eedaaadb19919781698b4d262f # action/v1.0.0 | |
| if: steps.check-changes.outputs.commit_changes == 'true' | |
| with: | |
| token: "${{ steps.octo-sts.outputs.token }}" | |
| branch: "${{ steps.define-branch.outputs.branch }}" | |
| # for scheduled runs, sha is the tip of the default branch | |
| # for dispatched runs, sha is the tip of the branch it was dispatched on | |
| branch-from: "${{ github.sha }}" | |
| command: push | |
| commits: "${{ steps.create-commit.outputs.commit }}" | |
| - name: Create pull request | |
| if: steps.check-changes.outputs.commit_changes == 'true' | |
| env: | |
| GH_TOKEN: ${{ steps.octo-sts.outputs.token }} | |
| run: | | |
| gh pr create --title "Update agent-jmxfetch submodule" \ | |
| --base master \ | |
| --head ${{ steps.define-branch.outputs.branch }} \ | |
| --label "comp: tooling" \ | |
| --label "type: enhancement" \ | |
| --label "tag: no release notes" \ | |
| --body "This PR updates the agent-jmxfetch submodule." |