Commit 3f93378
authored
feat: prevent versioned 3P GitHub actions in PR builds (#475)
Add validation step to require commit SHAs instead of version tags for
third-party GitHub actions in workflow files. Also fix the one we
missed: `aquasecurity/trivy-action` - depending on `master` is pretty
unusual and not trivial to catch, ultimately the Repo config `Require
actions to be pinned to a full-length commit SHA` will protect against
this if we missed any others.
### Testing done
* `Python Instrumentation PR Build / static-code-checks (pull_request)`
passes
* `Check CHANGELOG` fails, causing PR-build to fail, but `Check for
versioned GitHub action` passes:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17924516041/job/50967250100?pr=475
* Added various [`@v` in
code](f2f0523),
only finds uncommented ones:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17925754982/job/50971348934?pr=475
```
Found versioned GitHub actions. Use commit SHAs instead:
.github/actions/lambda_artifacts_build/action.yml:30: - uses: actions/checkout@v4
.github/actions/lambda_artifacts_build/action.yml:42: - uses: actions/checkout@v4 #v4
.github/workflows/daily-scan.yml:54: - uses: actions/checkout@v4 #v4
.github/workflows/daily-scan.yml:106: - uses: actions/checkout@v4
```
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.1 parent a1ce74e commit 3f93378
2 files changed
+21
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
55 | 74 | | |
56 | 75 | | |
57 | 76 | | |
| |||
0 commit comments