|
9 | 9 | build: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | permissions: |
12 | | - contents: write # Required to create and push branch |
| 12 | + contents: read |
13 | 13 | id-token: write # Required for OIDC token federation |
14 | 14 | steps: |
15 | 15 | - uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3 |
@@ -38,21 +38,25 @@ jobs: |
38 | 38 | if: steps.check-changes.outputs.commit_changes == 'true' |
39 | 39 | id: define-branch |
40 | 40 | run: echo "branch=ci/update-jmxfetch-submodule-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT |
41 | | - - name: Create branch |
| 41 | + - name: Commit changes |
42 | 42 | if: steps.check-changes.outputs.commit_changes == 'true' |
43 | | - run: | |
44 | | - git checkout -b ${{ steps.define-branch.outputs.branch }} |
45 | | - git push -u origin ${{ steps.define-branch.outputs.branch }} --force |
46 | | - - name: Commit and push changes |
47 | | - if: steps.check-changes.outputs.commit_changes == 'true' |
48 | | - env: |
49 | | - GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }} |
| 43 | + id: create-commit |
50 | 44 | run: | |
51 | 45 | git config user.name "github-actions[bot]" |
52 | 46 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
53 | | - git add dd-java-agent/agent-jmxfetch/integrations-core |
54 | | - git commit -m "Update agent-jmxfetch submodule" |
55 | | - git push origin ${{ steps.define-branch.outputs.branch }} |
| 47 | + git commit -m "feat(ci): Update agent-jmxfetch submodule" dd-java-agent/agent-jmxfetch/integrations-core |
| 48 | + echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT |
| 49 | + - name: Push changes |
| 50 | + uses: DataDog/commit-headless@1186485b788f57eedaaadb19919781698b4d262f # action/v1.0.0 |
| 51 | + if: steps.check-changes.outputs.commit_changes == 'true' |
| 52 | + with: |
| 53 | + token: "${{ steps.octo-sts.outputs.token }}" |
| 54 | + branch: "${{ steps.define-branch.outputs.branch }}" |
| 55 | + # for scheduled runs, sha is the tip of the default branch |
| 56 | + # for dispatched runs, sha is the tip of the branch it was dispatched on |
| 57 | + branch-from: "${{ github.sha }}" |
| 58 | + command: push |
| 59 | + commits: "${{ steps.create-commit.outputs.commit }}" |
56 | 60 | - name: Create pull request |
57 | 61 | if: steps.check-changes.outputs.commit_changes == 'true' |
58 | 62 | env: |
|
0 commit comments