Skip to content

Commit 37844a6

Browse files
authored
CI: Update GitHub actions (#131)
* ci: update GitHub actions - Update most GitHub actions to newer versions - Pin most actions to commit SHA for security * ci: replace `dorny/paths-filter` action - Replace `dorny/paths-filter` with `tj-actions/changed-files` for maintained status. Use SHA pinning for security - Add `src/pages/**` to file watchlist * ci: rewrite SVG optimizer action `ericcornelissen/svgo-action` is deprecated, and should be replaced. There is no easy action to replace it; instead, use more targeted logic. * ci: Make dependabot check GitHub actions monthly * ci: Remove unnecessary `fetch-depth` property from checkout actions * ci: Set bash as the default shell for actions that use it * chore (config): consolidate `markdown` config block There were two markdown blocks. Now there are one.
1 parent 2a9d301 commit 37844a6

File tree

10 files changed

+276
-242
lines changed

10 files changed

+276
-242
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ updates:
1010
directory: "/"
1111
schedule:
1212
interval: weekly
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: monthly

.github/workflows/deploy-preview.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ on:
66
- main
77
# Review gh actions docs if you want to further define triggers, paths, etc
88
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9-
9+
defaults:
10+
run:
11+
shell: bash
1012
jobs:
1113
build:
1214
name: Test deployment
1315
runs-on: ubuntu-latest
1416
steps:
15-
- uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
- uses: actions/setup-node@v4
17+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
18+
19+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 #v6.0.0
1920
with:
2021
cache: npm
2122

@@ -30,7 +31,7 @@ jobs:
3031
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
3132

3233
# - name: Upload Build Artifact
33-
# uses: actions/upload-pages-artifact@v3
34+
# uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b #v4.0.0
3435
# with:
3536
# path: build
3637
# deploy:
@@ -51,10 +52,10 @@ jobs:
5152
# steps:
5253
# - name: Deploy to GitHub Pages
5354
# id: deployment
54-
# uses: actions/deploy-pages@v4
55+
# uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5
5556

5657
# - name: Add deployment URL as comment on PR
57-
# uses: actions/github-script@v7
58+
# uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0
5859
# with:
5960
# github-token: ${{ secrets.GITHUB_TOKEN }}
6061
# script: |

.github/workflows/deploy.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ on:
77
# repository_dispatch: # TODO: Configure repository_dispatch event in update-common.yml
88
# types:
99
# - update-common-package-complete
10-
10+
defaults:
11+
run:
12+
shell: bash
1113
jobs:
1214
build:
1315
name: Build Docusaurus
1416
runs-on: ubuntu-latest
1517
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
- uses: actions/setup-node@v4
18+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
19+
20+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 #v6.0.0
2021
with:
2122
cache: npm
2223

@@ -31,7 +32,7 @@ jobs:
3132
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
3233

3334
- name: Upload Build Artifact
34-
uses: actions/upload-pages-artifact@v3
35+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b #v4.0.0
3536
with:
3637
path: build
3738

@@ -53,7 +54,7 @@ jobs:
5354
steps:
5455
- name: Deploy to GitHub Pages
5556
id: deployment
56-
uses: actions/deploy-pages@v4
57+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5
5758

5859
sync_inkeep:
5960
name: Sync Content with Inkeep
@@ -65,17 +66,17 @@ jobs:
6566

6667
steps:
6768
- name: Checkout
68-
uses: actions/checkout@v4
69-
- name: Check for changes
70-
uses: dorny/paths-filter@v2
71-
id: changes
69+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
70+
- name: Check for changed pages
71+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0
72+
id: changed-pages
7273
with:
73-
filters: |
74-
docs:
75-
- 'docs/**'
74+
files: |
75+
docs/**
76+
src/pages/**
7677
- name: Sync Sources
77-
if: steps.changes.outputs.docs == 'true'
78-
uses: inkeep/pr-commenter-action@v10
78+
if: steps.changed-pages.outputs.any_changed == 'true'
79+
uses: inkeep/pr-commenter-action@84ccc7c74b72f628ec7e2b572e0cb7afd5898594 #v10
7980
env:
8081
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
8182
with:

.github/workflows/doc-detective.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runTests:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: doc-detective/github-action@v1
17+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
18+
- uses: doc-detective/github-action@7cd1f3609abc91634935dbc990bfa7b6e6326f71 #latest, May 7 2025
1919
with:
2020
exit_on_fail: true

.github/workflows/ekline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
name: runner / EkLine Reviewer (github-pr-review)
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: ekline-io/ekline-github-action@v6
13+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
14+
- uses: ekline-io/ekline-github-action@6f79f8e33a245e231d3cc822e51a6a1d93d78638 #v6.46.2
1515
with:
1616
content_dir: ./docs
1717
ek_token: ${{ secrets.ek_token }}

.github/workflows/optimize-svg.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Optimize new SVG images
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
defaults:
7+
run:
8+
shell: bash
9+
jobs:
10+
svgs:
11+
name: Optimize SVGs
12+
runs-on: ubuntu-latest
13+
permissions:
14+
# Give the default GITHUB_TOKEN write permission to commit and push the
15+
# added or changed files to the repository.
16+
contents: write
17+
steps:
18+
19+
- name: Checkout repository
20+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
21+
22+
- name: Check for changed SVGs
23+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0
24+
id: changed-files
25+
with:
26+
safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection.
27+
files: |
28+
**/*.svg
29+
30+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 #v6.0.0
31+
if: steps.changed-files.outputs.any_changed == 'true'
32+
33+
- name: Optimize files
34+
if: steps.changed-files.outputs.any_changed == 'true'
35+
env:
36+
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
37+
run: |
38+
npm install -g svgo
39+
for file in ${ALL_CHANGED_FILES}; do
40+
npx svgo --multipass "$file" --output "$file"
41+
done
42+
43+
- name: Commit optimized SVGs
44+
if: steps.changed-files.outputs.any_changed == 'true'
45+
uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 #v7.0.0
46+
with:
47+
commit_message: "auto: optimize SVGs"

.github/workflows/optimize.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/update-common.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ on:
1010
description: 'The doc-detective-common version.'
1111
required: false
1212
default: 'latest'
13-
13+
defaults:
14+
run:
15+
shell: bash
1416
jobs:
1517
update:
1618
permissions:
1719
contents: write
1820
runs-on: ubuntu-latest
1921
steps:
2022
- name: Checkout code
21-
uses: actions/checkout@v4
23+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
2224
with:
2325
token: ${{ secrets.DD_DEP_UPDATE_TOKEN }}
2426

@@ -129,7 +131,7 @@ jobs:
129131
130132
- name: Create release with detailed notes
131133
if: steps.commit.outputs.has_changes == 'true'
132-
uses: softprops/action-gh-release@v2
134+
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe #v2.4.2
133135
with:
134136
body: |
135137
# What's new

.github/workflows/vale.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
1515

1616
- name: Set up dependencies
1717
run: npm install -g mdx2vast
1818

1919
- name: Run Vale
20-
uses: errata-ai/[email protected]
20+
uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c #v2.1.1
2121
with:
2222
files: "docs/"
2323
fail_on_error: false

0 commit comments

Comments
 (0)