-
Notifications
You must be signed in to change notification settings - Fork 524
43 lines (37 loc) · 1.56 KB
/
dependabot_serverless_gomod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Dependabot serverless gomod update
on: pull_request
# NOTE: For this job, we are unable to use the GITHUB_TOKEN from the action
# itself. The reason for this is that the tokens handed out for actions dont'
# contain the necessary permissions to kick off workflows in the case a new
# commit is added, as is the case here. For this job, we use the GH_BOT token
# secret in the repo, which has the necessary permissions. This allows the
# final commit+push on this job to execute the rest of the workflow required by
# the PR build configuration.
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
- name: Update serverless gomod
run: make -C cmd/tempo-serverless update-mod
- name: Commit serverless gomod changes
run: |
git config user.name grafanabot
git config user.email bot@grafana.com
git add cmd/tempo-serverless/lambda/go.mod
git add cmd/tempo-serverless/lambda/go.sum
git add cmd/tempo-serverless/cloud-run/go.mod
git add cmd/tempo-serverless/cloud-run/go.sum
git diff --quiet --staged || git commit -m 'Update serverless gomod'
- name: Push changes
run: |
git push origin ${{ github.head_ref }}