-
Notifications
You must be signed in to change notification settings - Fork 16
43 lines (41 loc) · 1.43 KB
/
check-promtail-releases.yaml
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: Check for new Promtail releases
on:
# Manual trigger
workflow_dispatch:
# Check regularly the upstream every four hours
schedule:
- cron: '0 0,4,8,12,16,20 * * *'
jobs:
check:
name: Detect new releases
runs-on: ubuntu-latest
outputs:
release: ${{steps.check.outputs.release}}
steps:
# Find out what is the latest release of grafana/loki
- id: loki-latest-release
uses: pozetroninc/[email protected]
with:
repository: grafana/loki
excludes: prerelease, draft
# Check out the tags of our repo to compare
- name: Checkout canonical/loki-k8s-operator
uses: actions/checkout@v2
with:
fetch-depth: 0
- id: check
name: Check for new releases
run: |
release=$(git show-ref --tags promtail-${{steps.loki-latest-release.outputs.release}} --quiet }} && echo -n '' || echo '${{ steps.loki-latest-release.outputs.release }}' )
if [ -n "${release}" ]; then
echo "::set-output name=release::${release}"
echo "New upstream release ${{steps.loki-latest-release.outputs.release}} found"
else
echo "No new upstream release found"
fi
trigger-build:
uses: ./.github/workflows/build-promtail-release.yaml
needs: check
if: ${{ needs.check.outputs.release != '' }}
with:
release: ${{needs.check.outputs.release}}