Skip to content

Commit 13bc2a1

Browse files
committed
Fix dependency update example workflow security checks
1 parent c16c0e5 commit 13bc2a1

1 file changed

Lines changed: 23 additions & 14 deletions

File tree

‎docs/examples/dependabot-cron/.github/workflows/deps-update.yml‎

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,47 @@ on:
1111
- cron: '0 9 * * 1'
1212
workflow_dispatch: # Allow manual trigger
1313

14-
permissions:
15-
contents: write
16-
pull-requests: write
14+
permissions: {}
1715

1816
jobs:
1917
update-deps:
2018
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
pull-requests: write
2122

2223
steps:
2324
- name: Checkout repository
24-
uses: actions/checkout@v4
25+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
2526
with:
2627
fetch-depth: 0 # Full history for branch operations
28+
persist-credentials: false
2729

2830
- name: Set up Go
29-
uses: actions/setup-go@v5
31+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
3032
with:
3133
go-version: '1.25'
3234

3335
# Install package managers that might be needed
3436
- name: Set up Node.js
35-
uses: actions/setup-node@v4
37+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3638
with:
3739
node-version: '20'
3840

39-
- name: Install pnpm
40-
run: npm install -g pnpm
41+
- name: Set up pnpm
42+
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
43+
with:
44+
version: latest
4145

4246
- name: Set up Ruby
43-
uses: ruby/setup-ruby@v1
47+
uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1.335.0
4448
with:
4549
ruby-version: '3.3'
4650

4751
- name: Set up Rust
48-
uses: dtolnay/rust-action@stable
52+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
53+
with:
54+
toolchain: stable
4955

5056
- name: Set up Python and uv
5157
run: |
@@ -72,10 +78,13 @@ jobs:
7278
env:
7379
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7480
run: |
75-
/tmp/deps-update ${{ github.workspace }}
81+
gh auth setup-git
82+
/tmp/deps-update "$GITHUB_WORKSPACE"
7683
7784
- name: Summary
7885
run: |
79-
echo "## Dependency Update Summary" >> $GITHUB_STEP_SUMMARY
80-
echo "" >> $GITHUB_STEP_SUMMARY
81-
echo "Check the Pull Requests tab for any new update PRs." >> $GITHUB_STEP_SUMMARY
86+
{
87+
echo "## Dependency Update Summary"
88+
echo ""
89+
echo "Check the Pull Requests tab for any new update PRs."
90+
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)