Skip to content

Commit a0ba932

Browse files
authored
Configure ako-releaser bot to sign commits (#2270)
1 parent e43d890 commit a0ba932

File tree

4 files changed

+28
-17
lines changed

4 files changed

+28
-17
lines changed

.github/workflows/devbox-update.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ jobs:
1212
steps:
1313
- name: Checkout Repository
1414
uses: actions/checkout@v4
15-
15+
- name: Generate GitHub App Token
16+
id: generate_token
17+
uses: actions/create-github-app-token@v1
18+
with:
19+
app-id: ${{ secrets.AKO_RELEASER_APP_ID }}
20+
private-key: ${{ secrets.AKO_RELEASER_RSA_KEY }}
21+
owner: ${{ github.repository_owner }}
22+
repositories: mongodb-atlas-kubernetes
1623
- name: Install devbox
1724
uses: jetify-com/[email protected]
1825
with:
1926
enable-cache: 'true'
20-
2127
- name: Update Devbox
2228
run: |
2329
devbox update
@@ -32,20 +38,18 @@ jobs:
3238
echo "Changes detected."
3339
echo "CHANGES=true" >> $GITHUB_OUTPUT
3440
fi
35-
3641
- name: Generate Branch Name
3742
id: generate_branch
3843
if: steps.check_changes.outputs.CHANGES == 'true'
3944
run: |
4045
RANDOM_NUM=$((RANDOM % 10000)) # Generate a random number between 0 and 9999
4146
BRANCH_NAME="devbox-update-$(date +'%Y-%m-%d')-$RANDOM_NUM"
4247
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT # Export branch name
43-
4448
- name: Commit and Push Changes
4549
if: steps.check_changes.outputs.CHANGES == 'true'
4650
run: |
47-
git config --local user.email "akobot@ako-team-fake.mongodb.com"
48-
git config --local user.name "AKOBot"
51+
git config user.name "ako-releaser"
52+
git config user.email "285350+your-app[bot]@users.noreply.github.com"
4953
git checkout -b ${{ steps.generate_branch.outputs.BRANCH_NAME }} # New branch
5054
git add .
5155
git commit -m "Weekly devbox dependencies update"

.github/workflows/sync-helm-charts.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ jobs:
9999
COMMIT_MSG="[autogenerated] update AKO helm-charts ${jobname} by @${{ github.event.pull_request.user.login }}"
100100
echo "Changes detected. Creating PR"
101101
102-
git config --local user.email "akobot@ako-team-fake.mongodb.com"
103-
git config --local user.name "ako-releaser"
102+
git config user.name "ako-releaser"
103+
git config user.email "285350+your-app[bot]@users.noreply.github.com"
104104
105105
git checkout -b "${BRANCH_NAME}"
106106
git add .

.github/workflows/update-helm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ jobs:
8181
COMMIT_MSG="[autogenerated] update CRDs and RBAC ${jobname}"
8282
echo "Changes detected. Creating PR"
8383
84-
git config --local user.email "akobot@ako-team-fake.mongodb.com"
85-
git config --local user.name "ako-releaser"
84+
git config user.name "ako-releaser"
85+
git config user.email "285350+your-app[bot]@users.noreply.github.com"
8686
8787
git checkout -b "${BRANCH_NAME}"
8888
git add .

.github/workflows/update-licenses.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,32 @@ jobs:
2626
JWT_APP_ID: ${{ secrets.AKO_RELEASER_APP_ID }}
2727
JWT_RSA_PEM_KEY_BASE64: ${{ secrets.AKO_RELEASER_RSA_KEY_BASE64 }}
2828
steps:
29-
- uses: actions/checkout@v4
29+
- name: Checkout AKO repo
30+
uses: actions/checkout@v4
3031
with:
3132
ref: ${{ env.BRANCH }}
33+
- name: Generate GitHub App Token
34+
id: generate_token
35+
uses: actions/create-github-app-token@v1
36+
with:
37+
app-id: ${{ secrets.AKO_RELEASER_APP_ID }}
38+
private-key: ${{ secrets.AKO_RELEASER_RSA_KEY }}
39+
owner: ${{ github.repository_owner }}
40+
repositories: mongodb-atlas-kubernetes
3241
- name: Install devbox
3342
uses: jetify-com/[email protected]
3443
with:
3544
enable-cache: 'true'
36-
3745
- name: Recompute licenses
3846
run: devbox run -- 'make recompute-licenses'
39-
4047
- name: Commit as needed
48+
env:
49+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
4150
run: |
42-
make tools/makejwt/makejwt
43-
export GITHUB_TOKEN=$(make github-token)
4451
if [[ $(git diff --stat) != '' ]]; then
4552
echo 'Committing changes'
46-
git config user.email "akobot@ako-team-fake.mongodb.com"
47-
git config user.name "AKOBot"
53+
git config user.name "ako-releaser"
54+
git config user.email "285350+your-app[bot]@users.noreply.github.com"
4855
git add .
4956
git commit -m "Fix licenses after dependabot changes" -m "[dependabot skip]"
5057
git push

0 commit comments

Comments
 (0)