1515 update-docker-build-image :
1616 runs-on : ubuntu-latest
1717 permissions :
18- contents : write # Required to create and push branch
18+ contents : read
1919 id-token : write # Required for OIDC token federation
2020 steps :
2121 - uses : DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
@@ -58,11 +58,12 @@ jobs:
5858 else
5959 echo "commit_changes=true" >> "$GITHUB_OUTPUT"
6060 fi
61- - name : Download ghcommit CLI
61+ - name : Configure git
6262 if : steps.check-changes.outputs.commit_changes == 'true'
63+ id : configure-git
6364 run : |
64- curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
65- chmod +x /usr/local/bin/ghcommit
65+ git config user.name "github-actions[bot]"
66+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6667 - name : Pick a branch name
6768 if : steps.check-changes.outputs.commit_changes == 'true'
6869 id : define-branch
@@ -72,16 +73,23 @@ jobs:
7273 run : |
7374 git checkout -b ${{ steps.define-branch.outputs.branch }}
7475 git push -u origin ${{ steps.define-branch.outputs.branch }} --force
75- - name : Commit and push changes
76- if : steps.check-changes.outputs.commit_changes == 'true'
7776 env :
7877 GITHUB_TOKEN : ${{ steps.octo-sts.outputs.token }}
78+ - name : Commit changes
79+ if : steps.check-changes.outputs.commit_changes == 'true'
80+ id : create-commit
7981 run : |
80- ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add .gitlab-ci.yml --message "feat(ci): Update Docker build image"
82+ git commit --message "feat(ci): Update Docker build image" .gitlab-ci.yml
83+ echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
84+ - name : Push changes
85+ uses : Asana/push-signed-commits@d615ca88d8e1a946734c24970d1e7a6c56f34897
86+ if : ${{ steps.create-commit.outputs.commit != '' }}
87+ with :
88+ github-token : ${{ steps.octo-sts.outputs.token }}
89+ local_branch_name : ${{ steps.define-branch.outputs.branch }}
90+ remote_branch_name : ${{ steps.define-branch.outputs.branch }}
8191 - name : Create pull request
8292 if : steps.check-changes.outputs.commit_changes == 'true'
83- env :
84- GH_TOKEN : ${{ steps.octo-sts.outputs.token }}
8593 run : |
8694 gh pr create --title "Update Docker build image" \
8795 --base master \
9098 --label "type: enhancement" \
9199 --label "tag: no release notes" \
92100 --body "This PR updates the Docker build image to ${{ steps.define-tag.outputs.tag }}."
101+ env :
102+ GITHUB_TOKEN : ${{ steps.octo-sts.outputs.token }}
0 commit comments