diff --git a/.github/workflows/prometheusrule.yml b/.github/workflows/prometheusrule.yml index 305b12629..6d040034a 100644 --- a/.github/workflows/prometheusrule.yml +++ b/.github/workflows/prometheusrule.yml @@ -15,5 +15,10 @@ jobs: - uses: actions/setup-go@v2 with: go-version: '1.15' - - run: go get -u github.com/prometheus/prometheus/cmd/promtool - - run: verify-prometheus-rules.sh + - run: go get -u github.com/brancz/gojsontoyaml + #- run: go get -u github.com/prometheus/prometheus/cmd/promtool + - name: Download latest release of promtool + run: | + VERSION=$(curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}' | sed 's/v//') + curl -s -L "https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-${VERSION}.linux-amd64.tar.gz" | tar -zxf - -C "${GITHUB_WORKSPACE}/" --strip-components 1 "prometheus-${VERSION}.linux-amd64/promtool" + - run: PATH="${PATH}:${GITHUB_WORKSPACE}" ./hack/verify-prometheus-rules.sh