Skip to content

Commit 2d88d90

Browse files
authored
ci: Add Github Actions lint check (#2196)
We already use this in the tooling repositories and in `apify/workflows`, and I find it pretty useful in all repositories that define GitHub Actions, as it helps reduce the risk of merging invalid workflows.
1 parent 26791b1 commit 2d88d90

5 files changed

Lines changed: 33 additions & 20 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Actions lint check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
actions_lint_check:
11+
name: Actions lint check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v6
16+
- name: Run actionlint
17+
uses: rhysd/actionlint@v1.7.10

.github/workflows/docs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
node-version: 24
2525
cache: 'npm'
2626
cache-dependency-path: 'package-lock.json'
27-
always-auth: 'true'
2827

2928
- name: Enable corepack
3029
run: |

.github/workflows/lychee.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
node-version: 24
1818
cache: 'npm'
1919
cache-dependency-path: 'package-lock.json'
20-
always-auth: 'true'
2120

2221
- name: Enable corepack
2322
run: |

.github/workflows/publish-to-npm.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ jobs:
5656
cache: 'npm'
5757
registry-url: 'https://registry.npmjs.org'
5858
cache-dependency-path: 'package-lock.json'
59-
always-auth: 'true'
6059

6160
- name: Enable corepack
6261
run: |
@@ -69,23 +68,22 @@ jobs:
6968
7069
- name: Bump the theme version
7170
run: |
72-
cd $GITHUB_WORKSPACE/apify-docs-theme
71+
cd "$GITHUB_WORKSPACE/apify-docs-theme"
7372
npm version patch --legacy-peer-deps
7473
7574
- name: Deploy theme to npm
7675
run: |
77-
cd $GITHUB_WORKSPACE/apify-docs-theme
76+
cd "$GITHUB_WORKSPACE/apify-docs-theme"
7877
npm publish
7978
8079
- name: Wait until the new theme version is available on npm
8180
run: |
82-
cd $GITHUB_WORKSPACE/apify-docs-theme
83-
PACKAGE_JSON=$(cat package.json);
84-
PACKAGE_NAME=$(jq -r .name <(echo $PACKAGE_JSON));
85-
PACKAGE_VER=$(jq -r .version <(echo $PACKAGE_JSON));
86-
for i in $(seq 1 10); do
81+
cd "$GITHUB_WORKSPACE/apify-docs-theme"
82+
PACKAGE_NAME=$(jq -r .name package.json);
83+
PACKAGE_VER=$(jq -r .version package.json);
84+
for _ in $(seq 1 10); do
8785
EXIT_CODE=0;
88-
npm show $PACKAGE_NAME@$PACKAGE_VER || EXIT_CODE=1;
86+
npm show "$PACKAGE_NAME@$PACKAGE_VER" || EXIT_CODE=1;
8987
if [[ $EXIT_CODE -eq 1 ]]; then
9088
echo "The new package version ($PACKAGE_VER) is not yet available, waiting 30 seconds...";
9189
sleep 30;
@@ -94,7 +92,7 @@ jobs:
9492
echo "The new package version ($PACKAGE_VER) is live, proceeding!";
9593
break;
9694
done;
97-
npm show $PACKAGE_NAME@$PACKAGE_VER # fails if the package is not available, succeeds if it is
95+
npm show "$PACKAGE_NAME@$PACKAGE_VER" # fails if the package is not available, succeeds if it is
9896
9997
- name: Commit the new theme version
10098
uses: stefanzweifel/git-auto-commit-action@v7

.github/workflows/test.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
node-version: 24
2020
cache: 'npm'
2121
cache-dependency-path: 'package-lock.json'
22-
always-auth: 'true'
2322

2423
- name: Enable corepack
2524
run: |
@@ -48,19 +47,20 @@ jobs:
4847
4948
- name: Start Nginx with project config
5049
run: |
50+
PWD_PATH="$(pwd)"
5151
cat > default.conf <<EOF
5252
worker_processes auto;
53-
error_log $(pwd)/logs/error.log;
54-
pid $(pwd)/logs/nginx.pid;
53+
error_log ${PWD_PATH}/logs/error.log;
54+
pid ${PWD_PATH}/logs/nginx.pid;
5555
events {}
5656
http {
57-
access_log $(pwd)/logs/access.log;
58-
include $(pwd)/nginx.conf;
57+
access_log ${PWD_PATH}/logs/access.log;
58+
include ${PWD_PATH}/nginx.conf;
5959
}
6060
EOF
6161
sed -i 's|https://apify.github.io/apify-docs|http://localhost:3000|g' default.conf
62-
mkdir -p $(pwd)/logs
63-
nginx -c $(pwd)/default.conf
62+
mkdir -p "${PWD_PATH}/logs"
63+
nginx -c "${PWD_PATH}/default.conf"
6464
sleep 1
6565
6666
- name: Run header assertions
@@ -137,7 +137,7 @@ jobs:
137137
138138
- name: Stop Nginx
139139
if: always()
140-
run: nginx -c $(pwd)/default.conf -s stop
140+
run: nginx -c "$(pwd)/default.conf" -s stop
141141

142142
lint_content:
143143
name: Lint markdown content

0 commit comments

Comments
 (0)