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:
Samuel Berthe 2026-03-16 01:47:09 +01:00 committed by GitHub
parent e2af1325c6
commit 01a5791376
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -6,6 +6,9 @@ on:
branches:
- master
permissions:
contents: write
jobs:
publish:
name: Publish
@ -22,7 +25,7 @@ jobs:
ruby-version: 3.4
- name: Set up yq
uses: mikefarah/yq@master
uses: mikefarah/yq@v4
- name: Install liquid
run: |
@ -53,7 +56,7 @@ jobs:
# https://peterevans.dev/posts/github-actions-how-to-automate-code-formatting-in-pull-requests/
- name: Check for modified files
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
if: steps.git-check.outputs.modified != '0'
run: |

View file

@ -1,6 +1,10 @@
name: Promtool check
on: [pull_request, push]
on:
pull_request:
push:
branches:
- master
jobs:
promtool-check:
@ -16,7 +20,7 @@ jobs:
ruby-version: 3.4
- name: Set up yq
uses: mikefarah/yq@master
uses: mikefarah/yq@v4
- name: Install liquid
run: gem install liquid-cli