Skip to content

Commit 0f910aa

Browse files
Added github action to check the tempo docker version
1 parent da2de9b commit 0f910aa

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Check Tempo version
2+
3+
on:
4+
schedule:
5+
- cron: "0 8 * * 1" # every Monday at 08:00 UTC
6+
workflow_dispatch:
7+
8+
env:
9+
TEMPO_REPO: tempoxyz/tempo
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Get current and latest versions
21+
id: versions
22+
env:
23+
GH_TOKEN: ${{ github.token }}
24+
run: |
25+
current=$(grep '^DOCKER_IMAGE=' .envrc | sed 's/.*://')
26+
latest=$(gh api "repos/$TEMPO_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//')
27+
echo "current=$current" >> "$GITHUB_OUTPUT"
28+
echo "latest=$latest" >> "$GITHUB_OUTPUT"
29+
30+
- name: Update and open PR
31+
if: steps.versions.outputs.current != steps.versions.outputs.latest
32+
env:
33+
GH_TOKEN: ${{ github.token }}
34+
run: |
35+
old="${{ steps.versions.outputs.current }}"
36+
new="${{ steps.versions.outputs.latest }}"
37+
branch="chore/bump-tempo-${new}"
38+
39+
sed -i "s/${old}/${new}/g" .envrc docker-compose.yaml
40+
41+
git checkout -b "$branch"
42+
git add .envrc docker-compose.yaml
43+
git commit -m "chore: bump tempo image to ${new}"
44+
git push -u origin "$branch"
45+
gh pr create \
46+
--title "chore: bump tempo image to ${new}" \
47+
--body "Bumps \`DOCKER_IMAGE\` from \`${old}\` to \`${new}\`." \
48+
--base main

0 commit comments

Comments
 (0)