-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.45 KB
/
check-tempo-version.yaml
File metadata and controls
48 lines (41 loc) · 1.45 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
name: Check Tempo version
on:
schedule:
- cron: "0 8 * * 1" # every Monday at 08:00 UTC
workflow_dispatch:
env:
TEMPO_REPO: tempoxyz/tempo
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Get current and latest versions
id: versions
env:
GH_TOKEN: ${{ github.token }}
run: |
current=$(grep '^DOCKER_IMAGE=' .env.example | sed 's/.*://')
latest=$(gh api "repos/$TEMPO_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//')
echo "current=$current" >> "$GITHUB_OUTPUT"
echo "latest=$latest" >> "$GITHUB_OUTPUT"
- name: Update and open PR
if: steps.versions.outputs.current != steps.versions.outputs.latest
env:
GH_TOKEN: ${{ github.token }}
run: |
old="${{ steps.versions.outputs.current }}"
new="${{ steps.versions.outputs.latest }}"
branch="chore/bump-tempo-${new}"
sed -i "s/${old}/${new}/g" .env.example docker-compose.yaml
git checkout -b "$branch"
git add .env.example docker-compose.yaml
git commit -m "chore: bump tempo image to ${new}"
git push -u origin "$branch"
gh pr create \
--title "chore: bump tempo image to ${new}" \
--body "Bumps \`DOCKER_IMAGE\` from \`${old}\` to \`${new}\`." \
--base main