Repository navigation
98 lines (87 loc) · 3.25 KB
/
Copy pathupdate-python-offsets.yml
File metadata and controls
98 lines (87 loc) · 3.25 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Update Python Offsets
on:
schedule:
- cron: "5 10 * * 1"
workflow_dispatch:
permissions:
contents: write
jobs:
update-python-offsets:
runs-on: ubuntu-latest
steps:
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
# detached: true
- uses: actions/checkout@v7
with:
persist-credentials: 'false'
ref: ebpf/python-offsets
submodules: recursive
- name: Update offsets
working-directory: ebpf
run: |
make python/dwarfdump
make glibc/dwarfdump
make musl/dwarfdump
# - name: Update ebpf/testdata submodule
# working-directory: ebpf/testdata
# run: |
# git config pull.rebase true
# git pull
- name: Verify Changed files
id: verify-changed-files
run: |
git status
git diff
# If there are no changes exit code will be 0 and 1 if there are changes
if git diff --exit-code ebpf/python/glibc*.go ebpf/python/musl*.go ebpf/python/python*.go > /dev/null; then
echo "files_changed=false" >> $GITHUB_OUTPUT
else
echo "files_changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "bot@ceems.com"
git config --local user.name "CEEMS Bot"
git add -A
git commit -m "chore: Update Python/MUSL/GLIBC dwarfdumps" -s
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
id: push
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ebpf/python-offsets
push_to_submodules: on-demand
- name: Discord notification
if: steps.verify-changed-files.outputs.files_changed == 'true' || failure()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
if [ "${{ steps.push.outcome }}" == "success" ]; then
COLOR=5763719
STATUS="Success"
EMOJI=":white_check_mark:"
else
COLOR=15548997
STATUS="Failed"
EMOJI=":x:"
fi
curl -H "Content-Type: application/json" \
-d "{
\"embeds\": [{
\"title\": \"$EMOJI Update Python Offsets Scheduled Pipeline - $STATUS\",
\"description\": \"Updating Python offsets for ebpf package in \`${{ github.repository }}\`\",
\"color\": $COLOR,
\"fields\": [
{\"name\": \"Branch\", \"value\": \"\`${{ github.ref_name }}\`\", \"inline\": true},
{\"name\": \"Commit\", \"value\": \"\`${{ github.sha }}\`\", \"inline\": true},
{\"name\": \"Author\", \"value\": \"${{ github.actor }}\", \"inline\": true}
],
\"url\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
}]
}" \
$DISCORD_WEBHOOK