Skip to content

Commit

Permalink
Merge pull request #387 from Yoast/JRF/ghactions-add-actionlint
Browse files Browse the repository at this point in the history
GH Actions: add actionlint job
  • Loading branch information
jrfnl authored Dec 24, 2024
2 parents cb93525 + 8920567 commit fda1c5c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ on:
- 'composer.lock'
- '.phpcs.xml.dist'
- 'phpcs.xml.dist'
- '.github/workflows/cs.yml'
- '.github/workflows/**'
pull_request:
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
- '.phpcs.xml.dist'
- 'phpcs.xml.dist'
- '.github/workflows/cs.yml'
- '.github/workflows/**'
# Allow manually triggering the workflow.
workflow_dispatch:

Expand All @@ -30,6 +30,10 @@ concurrency:
cancel-in-progress: true

jobs:
actionlint:
name: 'Lint GH Action workflows'
uses: Yoast/.github/.github/workflows/reusable-actionlint.yml@main

checkcs:
name: 'Check code style'
runs-on: ubuntu-latest
Expand All @@ -44,11 +48,11 @@ jobs:
BASE_REF: ${{ github.base_ref }}
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "NAME=$BASE_REF" >> $GITHUB_OUTPUT
echo "REF=origin/$BASE_REF" >> $GITHUB_OUTPUT
echo "NAME=$BASE_REF" >> "$GITHUB_OUTPUT"
echo "REF=origin/$BASE_REF" >> "$GITHUB_OUTPUT"
else
echo 'NAME=develop' >> $GITHUB_OUTPUT
echo "REF=origin/develop" >> $GITHUB_OUTPUT
echo 'NAME=develop' >> "$GITHUB_OUTPUT"
echo "REF=origin/develop" >> "$GITHUB_OUTPUT"
fi
- name: Fetch base branch
Expand Down Expand Up @@ -83,7 +87,7 @@ jobs:
set +e
composer check-cs-thresholds
exitcode="$?"
echo "EXITCODE=$exitcode" >> $GITHUB_OUTPUT
echo "EXITCODE=$exitcode" >> "$GITHUB_OUTPUT"
exit "$exitcode"
# Check the codestyle only of the files which were changed in the current branch.
Expand Down

0 comments on commit fda1c5c

Please sign in to comment.