Skip to content

Commit f39f279

Browse files
authored
Enforce pinact on actions in plugins (#1142)
- Use pinact in the plugins repo - updates actions and workflows
1 parent 7f8d2f6 commit f39f279

14 files changed

Lines changed: 186 additions & 16 deletions

File tree

.github/actions/action_tests/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232
# The uv action tests' preCheck shells out to `uv lock` directly (not
3333
# through trunk), so we need uv available on PATH.
3434
- name: Setup uv
35-
uses: astral-sh/setup-uv@v5
35+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 uses: astral-sh/setup-uv@v5
3636
with:
3737
version: 0.7.8
3838

@@ -83,7 +83,7 @@ runs:
8383
- name: Upload prod results
8484
# TODO(Tyler): Add upload on Windows once the action supports it.
8585
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''"
86-
uses: trunk-io/analytics-uploader@main
86+
uses: trunk-io/analytics-uploader@413ecdb8036c3698131a278a921c8481ffeec502 # v2.1.1 uses: trunk-io/analytics-uploader@v2.1.1
8787
with:
8888
junit-paths: junit.xml
8989
org-slug: trunk

.github/actions/linter_tests/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ runs:
117117
- name: Upload prod results
118118
# TODO(Tyler): Add upload on Windows once the action supports it.
119119
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''"
120-
uses: trunk-io/analytics-uploader@main
120+
uses: trunk-io/analytics-uploader@413ecdb8036c3698131a278a921c8481ffeec502 # v2.1.1 uses: trunk-io/analytics-uploader@v2.1.1
121121
with:
122122
junit-paths: junit.xml
123123
org-slug: trunk

.github/actions/tool_tests/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ runs:
7979
- name: Upload prod results
8080
# TODO(Tyler): Add upload on Windows once the action supports it.
8181
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''"
82-
uses: trunk-io/analytics-uploader@main
82+
uses: trunk-io/analytics-uploader@413ecdb8036c3698131a278a921c8481ffeec502 # v2.1.1 uses: trunk-io/analytics-uploader@v2.1.1
8383
with:
8484
junit-paths: junit.xml
8585
org-slug: trunk

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ jobs:
3434

3535
# Initializes the CodeQL tools for scanning.
3636
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3.35.2
37+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 uses: github/codeql-action/init@v4.36.2
3838
# Override language selection by uncommenting this and choosing your languages
3939
with:
4040
languages: javascript
4141

4242
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
4343
# If this step fails, then you should remove it and run the build manually (see below).
4444
- name: Autobuild
45-
uses: github/codeql-action/autobuild@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3.35.2
45+
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 uses: github/codeql-action/autobuild@v4.36.2
4646

4747
# ℹ️ Command-line programs to run using the OS shell.
4848
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -56,4 +56,4 @@ jobs:
5656
# make release
5757

5858
- name: Perform CodeQL Analysis
59-
uses: github/codeql-action/analyze@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3.35.2
59+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 uses: github/codeql-action/analyze@v4.36.2

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232
lfs: true
233233

234234
- name: Trunk Check
235-
uses: trunk-io/trunk-action@75699af9e26881e564e9d832ef7dc3af25ec031b
235+
uses: trunk-io/trunk-action@75699af9e26881e564e9d832ef7dc3af25ec031b # v1.2.4 uses: trunk-io/trunk-action@75699af9e26881e564e9d832ef7dc3af25ec031b
236236
env:
237237
TRUNK_GITHUB_CHECK_RUN_TITLE: Trunk Check
238238

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
persist-credentials: false
3636

3737
- name: Run analysis
38-
uses: ossf/scorecard-action@99c09fe975337306107572b4fdf4db224cf8e2f2 # v2.4.3
38+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 uses: ossf/scorecard-action@v2.4.3
3939
with:
4040
results_file: results.sarif
4141
results_format: sarif
@@ -65,6 +65,6 @@ jobs:
6565

6666
# Upload the results to GitHub's code scanning dashboard.
6767
- name: Upload to code-scanning
68-
uses: github/codeql-action/upload-sarif@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3.35.2
68+
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 uses: github/codeql-action/upload-sarif@v4.36.2
6969
with:
7070
sarif_file: results.sarif

.github/workflows/upgrade_trunk.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ jobs:
1919
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020

2121
- name: Create App Token for TrunkBuild App (Internal)
22-
uses: tibdex/github-app-token@v2
22+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 uses: tibdex/github-app-token@v2
2323
id: generate-token
2424
with:
2525
app_id: ${{ secrets.TRUNK_OPEN_PR_APP_ID }}
2626
private_key: ${{ secrets.TRUNK_OPEN_PR_APP_PRIVATE_KEY }}
2727

2828
- name: Trunk Upgrade
29-
uses: trunk-io/trunk-action/upgrade@75699af9e26881e564e9d832ef7dc3af25ec031b
29+
uses: trunk-io/trunk-action/upgrade@75699af9e26881e564e9d832ef7dc3af25ec031b # v1.2.4 uses: trunk-io/trunk-action/upgrade@75699af9e26881e564e9d832ef7dc3af25ec031b
3030
with:
3131
arguments: -n --bleeding-edge
3232
github-token: ${{ steps.generate-token.outputs.token }}

.github/workflows/upload_results.reusable.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ jobs:
225225
git ls-files --others --exclude-standard | grep ".shot" | xargs sed -i '2i // trunk-upgrade-validation:RELEASE'
226226
227227
- name: Create App Token for TrunkBuild App (Internal)
228-
uses: tibdex/github-app-token@v2
228+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 uses: tibdex/github-app-token@v2
229229
id: generate-token
230230
with:
231231
app_id: ${{ secrets.TRUNK_OPEN_PR_APP_ID }}
232232
private_key: ${{ secrets.TRUNK_OPEN_PR_APP_PRIVATE_KEY }}
233233

234234
- name: Create Pull Request
235-
uses: peter-evans/create-pull-request@v7
235+
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11 uses: peter-evans/create-pull-request@v7
236236
with:
237237
title: Auto-add missing snapshots
238238
body:

.pinact.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/suzuki-shunsuke/pinact/refs/heads/main/json-schema/pinact.json
2+
# pinact - https://github.com/suzuki-shunsuke/pinact
3+
version: 3
4+
min_age:
5+
value: 30
6+
always: true
7+
8+
rules:
9+
- min_age: 0
10+
conditions:
11+
- expr: |
12+
ActionRepoFullName == "trunk-io/analytics-uploader" ||
13+
ActionRepoFullName == "github/codeql-action"

.trunk/trunk.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ lint:
4343
success_codes: [0]
4444
enabled:
4545
# enabled linters inherited from github.com/trunk-io/configs plugin
46+
- pinact@4.0.0
4647
- ls-lint@2.3.1
4748
- pmd@7.18.0
4849
- definition-checker

0 commit comments

Comments
 (0)