diff --git a/.github/actionlint-matcher.json b/.github/actionlint-matcher.json new file mode 100644 index 0000000000..4613e1617b --- /dev/null +++ b/.github/actionlint-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "actionlint", + "pattern": [ + { + "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 0000000000..5892ead822 --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,19 @@ +name: Lint GitHub Actions workflows +on: + push: + branches: [main] + paths: ['.github/workflows/**'] + pull_request: + paths: ['.github/workflows/**'] + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Enable the actionlint matcher + run: echo "::add-matcher::.github/actionlint-matcher.json" + - name: Lint GitHub Actions workflows + uses: docker://rhysd/actionlint:latest + with: + args: -color diff --git a/.github/workflows/trigger_all_tests.yml b/.github/workflows/trigger_all_tests.yml index ce19ef0a77..8cc6ef44ea 100644 --- a/.github/workflows/trigger_all_tests.yml +++ b/.github/workflows/trigger_all_tests.yml @@ -42,7 +42,7 @@ jobs: # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#cli-tools - id: 'get-branch' # the id here is important since it gets reused in the next step - run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName') + run: echo "branch=$(gh pr view "$PR_NO" --repo "$REPO" --json headRefName --jq '.headRefName')" >> "$GITHUB_OUTPUT" env: REPO: ${{ github.repository }} PR_NO: ${{ github.event.issue.number }}