Skip to content

Commit ae10d44

Browse files
authored
Merge pull request #392 from Yoast/JRF/ghactions-add-actionlint
GH Actions: add actionlint job
2 parents 6f7af74 + 641d6b2 commit ae10d44

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

.github/workflows/cs.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ on:
2222
- 'phpunit-wp.xml.dist'
2323
- 'yarn.lock'
2424
- '.github/dependabot.yml'
25-
- '.github/workflows/deploy.yml'
26-
- '.github/workflows/lint.yml'
27-
- '.github/workflows/test.yml'
2825
- 'config/**'
2926
- '!config/composer/actions.php'
3027
- 'css/**'
@@ -47,9 +44,6 @@ on:
4744
- 'phpunit-wp.xml.dist'
4845
- 'yarn.lock'
4946
- '.github/dependabot.yml'
50-
- '.github/workflows/deploy.yml'
51-
- '.github/workflows/lint.yml'
52-
- '.github/workflows/test.yml'
5347
- 'config/**'
5448
- '!config/composer/actions.php'
5549
- 'css/**'
@@ -64,6 +58,10 @@ concurrency:
6458
cancel-in-progress: true
6559

6660
jobs:
61+
actionlint:
62+
name: 'Lint GH Action workflows'
63+
uses: Yoast/.github/.github/workflows/reusable-actionlint.yml@main
64+
6765
checkcs:
6866
name: 'Check code style'
6967
runs-on: ubuntu-latest
@@ -78,11 +76,11 @@ jobs:
7876
BASE_REF: ${{ github.base_ref }}
7977
run: |
8078
if [ "${{ github.event_name }}" == "pull_request" ]; then
81-
echo "NAME=$BASE_REF" >> $GITHUB_OUTPUT
82-
echo "REF=origin/$BASE_REF" >> $GITHUB_OUTPUT
79+
echo "NAME=$BASE_REF" >> "$GITHUB_OUTPUT"
80+
echo "REF=origin/$BASE_REF" >> "$GITHUB_OUTPUT"
8381
else
84-
echo 'NAME=trunk' >> $GITHUB_OUTPUT
85-
echo "REF=origin/trunk" >> $GITHUB_OUTPUT
82+
echo 'NAME=trunk' >> "$GITHUB_OUTPUT"
83+
echo "REF=origin/trunk" >> "$GITHUB_OUTPUT"
8684
fi
8785
8886
- name: Fetch base branch
@@ -117,7 +115,7 @@ jobs:
117115
set +e
118116
composer check-cs-thresholds
119117
exitcode="$?"
120-
echo "EXITCODE=$exitcode" >> $GITHUB_OUTPUT
118+
echo "EXITCODE=$exitcode" >> "$GITHUB_OUTPUT"
121119
exit "$exitcode"
122120
123121
# Check the codestyle only of the files which were changed in the current branch.

.github/workflows/deploy.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,22 +144,22 @@ jobs:
144144
SHA: ${{ github.sha }}
145145
run: |
146146
shortsha=$(echo "$SHA" | cut -b 1-6)
147-
echo "SHORTSHA=$shortsha" >> $GITHUB_OUTPUT
147+
echo "SHORTSHA=$shortsha" >> "$GITHUB_OUTPUT"
148148
149149
- name: "Set variables: target branch, commit title"
150150
id: set_vars
151151
env:
152152
REF_NAME: ${{ github.ref_name }}
153153
run: |
154154
if [[ "${{ github.event_name }}" == 'push' && "${{ github.ref_type }}" == 'branch' && "$REF_NAME" != "${{ env.DIST_DEFAULT_BRANCH }}" ]]; then
155-
echo "BRANCH=$REF_NAME" >> $GITHUB_OUTPUT
156-
echo "TITLE=Syncing branch $REF_NAME (sha: ${{ steps.set_sha.outputs.SHORTSHA }})" >> $GITHUB_OUTPUT
155+
echo "BRANCH=$REF_NAME" >> "$GITHUB_OUTPUT"
156+
echo "TITLE=Syncing branch $REF_NAME (sha: ${{ steps.set_sha.outputs.SHORTSHA }})" >> "$GITHUB_OUTPUT"
157157
elif [[ "${{ github.event_name }}" == 'workflow_dispatch' && "$REF_NAME" != "${{ env.DIST_DEFAULT_BRANCH }}" ]]; then
158-
echo "BRANCH=$REF_NAME" >> $GITHUB_OUTPUT
159-
echo "TITLE=Manual deploy for $REF_NAME (sha: ${{ steps.set_sha.outputs.SHORTSHA }})" >> $GITHUB_OUTPUT
158+
echo "BRANCH=$REF_NAME" >> "$GITHUB_OUTPUT"
159+
echo "TITLE=Manual deploy for $REF_NAME (sha: ${{ steps.set_sha.outputs.SHORTSHA }})" >> "$GITHUB_OUTPUT"
160160
else # = Pushed tag.
161-
echo "BRANCH=${{ env.DIST_DEFAULT_BRANCH }}" >> $GITHUB_OUTPUT
162-
echo "TITLE=Release $REF_NAME" >> $GITHUB_OUTPUT
161+
echo "BRANCH=${{ env.DIST_DEFAULT_BRANCH }}" >> "$GITHUB_OUTPUT"
162+
echo "TITLE=Release $REF_NAME" >> "$GITHUB_OUTPUT"
163163
fi
164164
165165
- name: Checkout Yoast Dist repo
@@ -254,7 +254,7 @@ jobs:
254254
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
255255
env:
256256
REF_NAME: ${{ github.ref_name }}
257-
run: git tag "$REF_NAME" $(git rev-parse HEAD)
257+
run: git tag "$REF_NAME" "$(git rev-parse HEAD)"
258258

259259
- name: Push to target branch
260260
run: git push -u origin ${{ steps.set_vars.outputs.BRANCH }} --tags -v

0 commit comments

Comments
 (0)