mirror of
https://github.com/samber/awesome-prometheus-alerts.git
synced 2026-06-25 10:56:57 +08:00
fix: fix GitHub Actions workflow issues (#505)
- Replace deprecated ::set-output with $GITHUB_OUTPUT - Pin mikefarah/yq from @master to @v4 - Add explicit permissions: contents: write to publish workflow - Limit test workflow push trigger to master branch only
This commit is contained in:
parent
e2af1325c6
commit
01a5791376
2 changed files with 11 additions and 4 deletions
7
.github/workflows/dist.yml
vendored
7
.github/workflows/dist.yml
vendored
|
|
@ -6,6 +6,9 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
name: Publish
|
name: Publish
|
||||||
|
|
@ -22,7 +25,7 @@ jobs:
|
||||||
ruby-version: 3.4
|
ruby-version: 3.4
|
||||||
|
|
||||||
- name: Set up yq
|
- name: Set up yq
|
||||||
uses: mikefarah/yq@master
|
uses: mikefarah/yq@v4
|
||||||
|
|
||||||
- name: Install liquid
|
- name: Install liquid
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -53,7 +56,7 @@ jobs:
|
||||||
# https://peterevans.dev/posts/github-actions-how-to-automate-code-formatting-in-pull-requests/
|
# https://peterevans.dev/posts/github-actions-how-to-automate-code-formatting-in-pull-requests/
|
||||||
- name: Check for modified files
|
- name: Check for modified files
|
||||||
id: git-check
|
id: git-check
|
||||||
run: echo ::set-output name=modified::$(git status -s --porcelain | wc -l | awk '{$1=$1};1')
|
run: echo "modified=$(git status -s --porcelain | wc -l | awk '{$1=$1};1')" >> $GITHUB_OUTPUT
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
if: steps.git-check.outputs.modified != '0'
|
if: steps.git-check.outputs.modified != '0'
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
|
|
@ -1,6 +1,10 @@
|
||||||
name: Promtool check
|
name: Promtool check
|
||||||
|
|
||||||
on: [pull_request, push]
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
promtool-check:
|
promtool-check:
|
||||||
|
|
@ -16,7 +20,7 @@ jobs:
|
||||||
ruby-version: 3.4
|
ruby-version: 3.4
|
||||||
|
|
||||||
- name: Set up yq
|
- name: Set up yq
|
||||||
uses: mikefarah/yq@master
|
uses: mikefarah/yq@v4
|
||||||
|
|
||||||
- name: Install liquid
|
- name: Install liquid
|
||||||
run: gem install liquid-cli
|
run: gem install liquid-cli
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue