Skip to content

Commit 6699b68

Browse files
committed
actionlint.yml: update to match main configuration
1 parent 54b7e76 commit 6699b68

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

.github/workflows/actionlint.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
name: actionlint
1+
# This file is synced from the `.github` repository, do not modify it directly.
2+
name: Actionlint
23

34
on:
45
push:
56
branches:
67
- main
7-
paths:
8-
- '.github/workflows/*.ya?ml'
8+
- master
99
pull_request:
10-
paths:
11-
- '.github/workflows/*.ya?ml'
1210

1311
defaults:
1412
run:
@@ -25,15 +23,18 @@ env:
2523

2624
permissions: {}
2725

28-
# FIXME: The `Install tools` step fails inside the Docker container for some reason.
2926
jobs:
3027
workflow_syntax:
3128
if: github.repository_owner == 'Homebrew'
3229
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
container:
33+
image: ghcr.io/homebrew/ubuntu22.04:main
3334
steps:
3435
- name: Set up Homebrew
3536
id: setup-homebrew
36-
uses: Homebrew/actions/setup-homebrew@master
37+
uses: Homebrew/actions/setup-homebrew@main
3738
with:
3839
core: false
3940
cask: false
@@ -47,26 +48,39 @@ jobs:
4748
persist-credentials: false
4849

4950
- run: zizmor --format sarif . > results.sarif
51+
env:
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5053

5154
- name: Upload SARIF file
5255
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
56+
# We can't use the SARIF file when triggered by `merge_group` so we don't upload it.
57+
if: always() && github.event_name != 'merge_group'
5358
with:
5459
name: results.sarif
5560
path: results.sarif
5661

5762
- name: Set up actionlint
5863
run: |
59-
# Setting `shell: /bin/bash` prevents shellcheck from running on
60-
# those steps, so let's change them to `shell: bash` for linting.
64+
# In homebrew-core, setting `shell: /bin/bash` prevents shellcheck from running on
65+
# those steps, so let's change them to `shell: bash` temporarily for better linting.
6166
sed -i 's|shell: /bin/bash -x|shell: bash -x|' .github/workflows/*.y*ml
62-
# The JSON matcher needs to be accessible to the container host.
67+
68+
# In homebrew-core, the JSON matcher needs to be accessible to the container host.
6369
cp "$(brew --repository)/.github/actionlint-matcher.json" "$HOME"
70+
6471
echo "::add-matcher::$HOME/actionlint-matcher.json"
6572
6673
- run: actionlint
6774

6875
upload_sarif:
6976
needs: workflow_syntax
77+
# We want to always upload this even if `actionlint` failed.
78+
# This is only available on public repositories.
79+
if: >
80+
always() &&
81+
!contains(fromJSON('["cancelled", "skipped"]'), needs.workflow_syntax.result) &&
82+
!github.event.repository.private &&
83+
github.event_name != 'merge_group'
7084
runs-on: ubuntu-latest
7185
permissions:
7286
contents: read

0 commit comments

Comments
 (0)