Skip to content

Commit be0f279

Browse files
ci: add zizmor GitHub Actions security analysis (#5469)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent b513444 commit be0f279

11 files changed

Lines changed: 114 additions & 44 deletions

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Configures Dependabot to keep our GitHub Actions pinned references up to date.
2+
# Other ecosystems are intentionally not enabled here.
3+
#
4+
# Pair with the `unpinned-uses` policy enforced by `.github/workflows/zizmor.yml`:
5+
# zizmor requires actions to be pinned to a full-length commit SHA with the
6+
# version tag as a trailing comment. Dependabot will keep both in sync.
7+
version: 2
8+
updates:
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
cooldown:
14+
default-days: 7
15+
open-pull-requests-limit: 10
16+
commit-message:
17+
prefix: "ci"
18+
include: "scope"
19+
labels:
20+
- "dependencies"
21+
- "github-actions"

.github/workflows/auto-merge-on-docs-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Find and merge dependent PRs
12-
uses: actions/github-script@v8
12+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1313
with:
1414
script: |
1515
const version = context.payload.client_payload.version;
@@ -47,4 +47,4 @@ jobs:
4747
console.log(`Merged PR #${pr.number}: ${pr.title}`);
4848
}
4949
}
50-
}
50+
}

.github/workflows/check-devin-pr-assignee.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
if: ${{ github.event.pull_request.user.login == 'devin-ai-integration[bot]' }}
1414
steps:
1515
- name: Auto-assign requester from PR description
16-
uses: actions/github-script@v8
16+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
1717
with:
1818
github-token: ${{ secrets.GITHUB_TOKEN }}
1919
script: |

.github/workflows/check-links.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v5
19+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
20+
with:
21+
persist-credentials: false
2022

2123
- name: Create lychee config
2224
run: |
@@ -380,7 +382,7 @@ jobs:
380382
381383
382384
- name: Upload URLs (early, for debugging)
383-
uses: actions/upload-artifact@v6
385+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
384386
with:
385387
name: urls
386388
path: |
@@ -392,7 +394,7 @@ jobs:
392394
- name: Check GitHub links (very low concurrency to avoid 503 rate limiting)
393395
id: lychee_github
394396
if: steps.extract_github_http.outputs.github_http_count != '0'
395-
uses: lycheeverse/lychee-action@v2
397+
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
396398
with:
397399
args: >-
398400
--no-progress
@@ -408,7 +410,7 @@ jobs:
408410

409411
- name: Check non-GitHub links (high concurrency)
410412
id: lychee_main
411-
uses: lycheeverse/lychee-action@v2
413+
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
412414
with:
413415
args: >-
414416
--config lychee.toml
@@ -600,15 +602,15 @@ jobs:
600602
broken_count=$(wc -l < broken-links.txt | tr -d ' ')
601603
602604
# Get rate limit stats
603-
rate_limited="${{ steps.retry429.outputs.rate_limited_count }}"
605+
rate_limited="${STEPS_RETRY429_OUTPUTS_RATE_LIMITED_COUNT}"
604606
rate_limited=${rate_limited:-0}
605-
still_failing_429="${{ steps.retry429.outputs.still_failing_429 }}"
607+
still_failing_429="${STEPS_RETRY429_OUTPUTS_STILL_FAILING_429}"
606608
still_failing_429=${still_failing_429:-0}
607609
608610
# Get GitHub local verification stats
609-
github_verified="${{ steps.verify_github.outputs.verified_count }}"
611+
github_verified="${STEPS_VERIFY_GITHUB_OUTPUTS_VERIFIED_COUNT}"
610612
github_verified=${github_verified:-0}
611-
github_missing="${{ steps.verify_github.outputs.missing_count }}"
613+
github_missing="${STEPS_VERIFY_GITHUB_OUTPUTS_MISSING_COUNT}"
612614
github_missing=${github_missing:-0}
613615
614616
# Build clean errors-only report
@@ -682,9 +684,9 @@ jobs:
682684
cat lychee-summary-table.md
683685
echo ""
684686
# Get repo-internal GitHub URL counts
685-
verified_locally="${{ steps.retry429.outputs.verified_locally }}"
687+
verified_locally="${STEPS_RETRY429_OUTPUTS_VERIFIED_LOCALLY}"
686688
verified_locally=${verified_locally:-0}
687-
missing_locally="${{ steps.retry429.outputs.missing_locally }}"
689+
missing_locally="${STEPS_RETRY429_OUTPUTS_MISSING_LOCALLY}"
688690
missing_locally=${missing_locally:-0}
689691
690692
echo "Recovery Info:"
@@ -763,18 +765,25 @@ jobs:
763765
764766
echo ""
765767
} >> "$GITHUB_STEP_SUMMARY"
768+
env:
769+
STEPS_RETRY429_OUTPUTS_RATE_LIMITED_COUNT: ${{ steps.retry429.outputs.rate_limited_count }}
770+
STEPS_RETRY429_OUTPUTS_STILL_FAILING_429: ${{ steps.retry429.outputs.still_failing_429 }}
771+
STEPS_VERIFY_GITHUB_OUTPUTS_VERIFIED_COUNT: ${{ steps.verify_github.outputs.verified_count }}
772+
STEPS_VERIFY_GITHUB_OUTPUTS_MISSING_COUNT: ${{ steps.verify_github.outputs.missing_count }}
773+
STEPS_RETRY429_OUTPUTS_VERIFIED_LOCALLY: ${{ steps.retry429.outputs.verified_locally }}
774+
STEPS_RETRY429_OUTPUTS_MISSING_LOCALLY: ${{ steps.retry429.outputs.missing_locally }}
766775

767776
- name: Upload errors-only report
768777
if: always()
769-
uses: actions/upload-artifact@v6
778+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
770779
with:
771780
name: lychee-report
772781
path: ./lychee-report.md
773782
if-no-files-found: ignore
774783

775784
- name: Upload lychee outputs and verification results
776785
if: always()
777-
uses: actions/upload-artifact@v6
786+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
778787
with:
779788
name: lychee-outputs
780789
path: |
@@ -787,7 +796,7 @@ jobs:
787796
- name: Create PR for broken links
788797
id: create-pr
789798
if: steps.check_failures.outputs.has_other_failures == 'true' || steps.retry429.outputs.has_429_failures == 'true' || steps.verify_github.outputs.has_missing == 'true'
790-
uses: actions/github-script@v8
799+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
791800
env:
792801
DEVIN_PROMPT: |
793802
@devin-ai-integration Please fix the broken links detected by the scheduled link checker.
@@ -1042,7 +1051,7 @@ jobs:
10421051
10431052
- name: Send Slack notification for broken links
10441053
if: steps.create-pr.outputs.pr_created == 'true'
1045-
uses: actions/github-script@v8
1054+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
10461055
env:
10471056
SLACK_TOKEN: ${{ secrets.DEVIN_AI_PR_BOT_SLACK_TOKEN }}
10481057
PR_URL: ${{ steps.create-pr.outputs.pr_url }}
@@ -1085,14 +1094,18 @@ jobs:
10851094
if: steps.check_failures.outputs.has_other_failures == 'true' || steps.retry429.outputs.has_429_failures == 'true' || steps.verify_github.outputs.has_missing == 'true'
10861095
run: |
10871096
echo "Link check failed!"
1088-
if [ "${{ steps.check_failures.outputs.has_other_failures }}" == "true" ]; then
1097+
if [ "${STEPS_CHECK_FAILURES_OUTPUTS_HAS_OTHER_FAILURES}" == "true" ]; then
10891098
echo "There are broken links (non-429 failures) in the report."
10901099
fi
1091-
if [ "${{ steps.retry429.outputs.has_429_failures }}" == "true" ]; then
1100+
if [ "${STEPS_RETRY429_OUTPUTS_HAS_429_FAILURES}" == "true" ]; then
10921101
echo "Some URLs still returned 429 after exponential backoff retry."
10931102
echo "These URLs may need to be excluded or the rate limit needs more time to reset."
10941103
fi
1095-
if [ "${{ steps.verify_github.outputs.has_missing }}" == "true" ]; then
1104+
if [ "${STEPS_VERIFY_GITHUB_OUTPUTS_HAS_MISSING}" == "true" ]; then
10961105
echo "Some GitHub URLs point to paths that don't exist in the repos."
10971106
fi
10981107
exit 1
1108+
env:
1109+
STEPS_CHECK_FAILURES_OUTPUTS_HAS_OTHER_FAILURES: ${{ steps.check_failures.outputs.has_other_failures }}
1110+
STEPS_RETRY429_OUTPUTS_HAS_429_FAILURES: ${{ steps.retry429.outputs.has_429_failures }}
1111+
STEPS_VERIFY_GITHUB_OUTPUTS_HAS_MISSING: ${{ steps.verify_github.outputs.has_missing }}

.github/workflows/fern-scribe.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v5
19+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
2020
with:
2121
token: ${{ secrets.GITHUB_TOKEN }}
22+
persist-credentials: false
2223

2324
- name: Setup Node.js
24-
uses: actions/setup-node@v5
25+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
2526
with:
2627
node-version: '20'
2728
cache: 'npm'
@@ -62,7 +63,7 @@ jobs:
6263
6364
- name: Comment on issue
6465
if: success()
65-
uses: actions/github-script@v8
66+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
6667
with:
6768
script: |
6869
github.rest.issues.createComment({
@@ -74,12 +75,12 @@ jobs:
7475
7576
- name: Comment on failure
7677
if: failure()
77-
uses: actions/github-script@v8
78+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
7879
with:
7980
script: |
8081
github.rest.issues.createComment({
8182
issue_number: context.issue.number,
8283
owner: context.repo.owner,
8384
repo: context.repo.repo,
8485
body: '❌ **Fern Scribe encountered an error**\n\nThere was an issue processing your documentation request. Please check the action logs and try again.\n\nIf the problem persists, please contact the maintainers.'
85-
});
86+
});

.github/workflows/preview-docs.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Preview Docs
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types: [opened, synchronize, ready_for_review]
66
branches:
77
- main
@@ -15,17 +15,18 @@ jobs:
1515
contents: read # For checking out code
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v5
18+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
1919
with:
2020
fetch-depth: 0 # Fetch full history for git diff
21+
persist-credentials: false
2122

2223
- name: Checkout PR
2324
run: |
2425
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }}
2526
git checkout pr-${{ github.event.pull_request.number }}
2627
2728
- name: Setup Fern CLI
28-
uses: fern-api/setup-fern-cli@v1
29+
uses: fern-api/setup-fern-cli@d07601425e9c9ede8745d71ca75c4c462d98755d # v1
2930

3031
- name: Generate preview URL
3132
id: generate-docs
@@ -43,8 +44,9 @@ jobs:
4344
id: page-links
4445
env:
4546
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
47+
STEPS_GENERATE_DOCS_OUTPUTS_PREVIEW_URL: ${{ steps.generate-docs.outputs.preview_url }}
4648
run: |
47-
PREVIEW_URL="${{ steps.generate-docs.outputs.preview_url }}"
49+
PREVIEW_URL="${STEPS_GENERATE_DOCS_OUTPUTS_PREVIEW_URL}"
4850
CHANGED_FILES=$(git diff --name-only origin/main...HEAD -- '*.mdx' 2>/dev/null || echo "")
4951
5052
if [ -z "$CHANGED_FILES" ] || [ -z "$PREVIEW_URL" ]; then
@@ -69,16 +71,19 @@ jobs:
6971
7072
- name: Create comment content
7173
run: |
72-
echo ":herb: **Preview your docs:** <${{ steps.generate-docs.outputs.preview_url }}>" > comment.md
74+
echo ":herb: **Preview your docs:** <${STEPS_GENERATE_DOCS_OUTPUTS_PREVIEW_URL}>" > comment.md
7375
74-
if [ -n "${{ steps.page-links.outputs.page_links }}" ]; then
76+
if [ -n "${STEPS_PAGE_LINKS_OUTPUTS_PAGE_LINKS}" ]; then
7577
echo "" >> comment.md
7678
echo "Here are the markdown pages you've updated:" >> comment.md
77-
echo "${{ steps.page-links.outputs.page_links }}" >> comment.md
79+
echo "${STEPS_PAGE_LINKS_OUTPUTS_PAGE_LINKS}" >> comment.md
7880
fi
81+
env:
82+
STEPS_GENERATE_DOCS_OUTPUTS_PREVIEW_URL: ${{ steps.generate-docs.outputs.preview_url }}
83+
STEPS_PAGE_LINKS_OUTPUTS_PAGE_LINKS: ${{ steps.page-links.outputs.page_links }}
7984

8085
- name: Post PR comment
81-
uses: thollander/actions-comment-pull-request@v2.4.3
86+
uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # v2.4.3
8287
with:
8388
filePath: comment.md
8489
comment_tag: preview-docs

.github/workflows/publish-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v5
14+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
15+
with:
16+
persist-credentials: false
1517

1618
- name: Setup Fern CLI
17-
uses: fern-api/setup-fern-cli@v1
19+
uses: fern-api/setup-fern-cli@d07601425e9c9ede8745d71ca75c4c462d98755d # v1
1820

1921
- name: Publish Docs
2022
env:

.github/workflows/stale-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
stale:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/stale@v10
15+
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10
1616
with:
1717
stale-pr-message: 'This PR is stale because it has been open 25 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
1818
close-pr-message: 'This PR was closed because it has been inactive for 5 days after being marked stale.'

.github/workflows/update-versions.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ jobs:
99
update-versions:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
1313
with:
1414
ref: main
15+
persist-credentials: false
1516
- name: update-csharp-version
1617
run: curl -s "https://registry.hub.docker.com/v2/repositories/fernapi/fern-csharp-sdk/tags" | jq -r -j '[.results[] | select(.name != "latest" and .name != "AUTO")] | .[0].name' > fern/snippets/version-number-csharp.mdx
1718
- name: update-go-version
@@ -36,7 +37,7 @@ jobs:
3637
run: curl -s https://api.github.com/repos/fern-api/fern/releases/latest | jq -r -j '.tag_name' > fern/snippets/version-number-cli.mdx
3738
- name: create PR
3839
id: cpr
39-
uses: peter-evans/create-pull-request@v8
40+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
4041
with:
4142
commit-message: "update versions from docker hub"
4243
title: "Update versions from docker hub"
@@ -45,14 +46,15 @@ jobs:
4546
delete-branch: true
4647
- name: Enable Pull Request Automerge
4748
if: steps.cpr.outputs.pull-request-operation == 'created'
48-
uses: peter-evans/enable-pull-request-automerge@v3
49+
uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3
4950
with:
5051
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
5152
merge-method: squash
5253
- name: Approving PR
5354
if: steps.cpr.outputs.pull-request-operation == 'created'
5455
env:
5556
GH_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
57+
STEPS_CPR_OUTPUTS_PULL_REQUEST_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
5658
run: |
5759
echo "Approving PR"
58-
gh pr review ${{ steps.cpr.outputs.pull-request-number }} --approve
60+
gh pr review ${STEPS_CPR_OUTPUTS_PULL_REQUEST_NUMBER} --approve

.github/workflows/vale.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,25 @@ jobs:
1515
github.event.pull_request.user.login != 'fern-support' &&
1616
github.event.pull_request.user.login != 'github-actions'
1717
steps:
18-
- uses: actions/checkout@v5
18+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
19+
with:
20+
persist-credentials: false
1921

2022
- name: Get changed files
2123
id: changed-files
22-
uses: tj-actions/changed-files@v47
24+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
2325
with:
2426
files: |
2527
fern/**/*.md
2628
fern/**/*.mdx
2729
files_ignore: |
2830
**/changelog/**
29-
- uses: errata-ai/vale-action@reviewdog
31+
- uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
3032
if: steps.changed-files.outputs.any_changed == 'true'
3133
with:
3234
files: ${{ steps.changed-files.outputs.all_changed_files }}
3335
version: 3.12.0
3436
reporter: github-pr-review
3537
fail_on_error: false
3638
env:
37-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
39+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)