-
Notifications
You must be signed in to change notification settings - Fork 76
51 lines (47 loc) · 1.65 KB
/
update-offsets.yml
File metadata and controls
51 lines (47 loc) · 1.65 KB
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
44
45
46
47
48
49
50
51
name: Update offsets
on:
schedule:
- cron: '1 1 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
UpdateOffsets:
permissions:
contents: write # Required for creating PRs
runs-on: ubuntu-latest
if: github.repository == 'open-telemetry/opentelemetry-ebpf-instrumentation'
steps:
- name: "Checkout repo"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: true
- name: "Update Go"
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
cache: 'false'
go-version: '>=1.25'
check-latest: true
- name: "Update offsets"
run: make update-offsets
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: generate-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
- name: "Create/update PR"
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
message="Automatic update of offsets.json"
body="The offsets have been updated by go-offsets-tracker"
branch="otelbot/offset-content-auto-update"
git config user.name otelbot
git config user.email 197425009+otelbot@users.noreply.github.com
git checkout -b $branch
git commit -a -m "$message"
git push --set-upstream origin $branch
gh pr create --title "$message" \
--body "$body" \
--base main