-
Notifications
You must be signed in to change notification settings - Fork 35
[DI-48] fix: replace vulnerable tj-actions actions with dorny/paths-filter #3595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,29 +53,31 @@ jobs: | |
|
||
- name: Check For Solidity Changes | ||
id: filter_solidity | ||
uses: tj-actions/changed-files@v26.1 | ||
uses: dorny/paths-filter@v2 | ||
with: | ||
files: | | ||
**/*.sol | ||
filters: | | ||
sol: | ||
- '**/*.sol' | ||
|
||
- name: Check For GolangCI Changes | ||
id: golangci_changed | ||
uses: tj-actions/changed-files@v26.1 | ||
uses: dorny/paths-filter@v2 | ||
with: | ||
# note: without building a yaml tree of our workflow, we won't be able to tell if golangci version changed so any ci change triggers full lint. | ||
files: | | ||
.golangci.yml | ||
.golangci-version | ||
.github/workflows/go.yml | ||
filters: | | ||
config: | ||
- '.golangci.yml' | ||
- '.golangci-version' | ||
Comment on lines
63
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🛠️ Refactor suggestion ❓ Verification inconclusiveUpdate dorny/paths-filter Version for GolangCI Check Similarly, the “Check For GolangCI Changes” step is using Action Required: Upgrade dorny/paths-filter to a newer version In the workflow file ( 🧰 Tools🪛 actionlint (1.7.4)64-64: the runner of "dorny/paths-filter@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||
- '.github/workflows/go.yml' | ||
|
||
|
||
- name: Run step if any of the listed files above change | ||
if: steps.filter_solidity.outputs.any_changed == 'true' | ||
if: steps.filter_solidity.outputs.sol == 'true' | ||
run: | | ||
echo "One or more files listed above has changed." | ||
|
||
- name: Golangci changed | ||
if: steps.golangci_changed.outputs.any_changed == 'true' | ||
if: steps.golangci_changed.outputs.config == 'true' | ||
run: | | ||
echo "Golangci has changed." | ||
|
||
|
@@ -458,28 +460,29 @@ jobs: | |
GOMEMLIMIT: 6GiB | ||
GOGC: -1 | ||
|
||
- name: Verify Changed files | ||
uses: tj-actions/verify-changed-files@v11.1 | ||
id: verify-changed-files | ||
- name: Filter Changed files | ||
uses: dorny/paths-filter@v2 | ||
id: filter-changed-files | ||
with: | ||
files: | | ||
*.go | ||
filters: | | ||
go: | ||
- '*.go' | ||
Comment on lines
+464
to
+469
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusiveUpgrade dorny/paths-filter in Go Files Change Detection The “Filter Changed files” step (for Go files) is implemented with Action Required: Upgrade dorny/paths-filter Action in Workflow Our search confirms that the workflow file at
🧰 Tools🪛 actionlint (1.7.4)464-464: the runner of "dorny/paths-filter@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||
|
||
- name: List all changed files tracked and untracked files | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
- name: List changed files | ||
if: steps.filter-changed-files.outputs.go == 'true' | ||
run: | | ||
echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}" | ||
echo "Go files have been changed" | ||
|
||
# Fail if files need regeneration | ||
# TODO: this can run into a bit of a race condition if any other label is removed/added while this is run, look into fixing this by dispatching another workflow | ||
- name: Add Label | ||
if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed == 'true' }} | ||
if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.filter-changed-files.outputs.go == 'true' }} | ||
uses: ./.github/actions/add-label | ||
with: | ||
label: 'needs-go-generate-${{matrix.package}}' | ||
|
||
- name: Remove Label | ||
if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} | ||
if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.filter-changed-files.outputs.go != 'true' }} | ||
uses: ./.github/actions/remove-label | ||
with: | ||
label: 'needs-go-generate-${{matrix.package}}' | ||
|
@@ -613,28 +616,29 @@ jobs: | |
GOMEMLIMIT: 6GiB | ||
GOGC: -1 | ||
|
||
- name: Verify Changed files | ||
uses: tj-actions/verify-changed-files@v11 | ||
id: verify-changed-files | ||
- name: Filter Changed files | ||
uses: dorny/paths-filter@v2 | ||
id: filter-changed-files | ||
with: | ||
files: | | ||
*.go | ||
filters: | | ||
go: | ||
- '*.go' | ||
|
||
Comment on lines
+619
to
626
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainUpgrade dorny/paths-filter in Module Generation Another instance of Action Required: Upgrade dorny/paths-filter to the Latest Version Across Workflows It appears that the
For improved consistency and compatibility, please upgrade all usages of this action (including the module generation instance) to the latest released version. 🏁 Script executed: #!/bin/bash
# Search for all usages of dorny/paths-filter with version "v2" in GitHub workflow files.
rg "dorny/paths-filter@v2" .github/workflows Length of output: 357 Upgrade dorny/paths-filter Action Version Across Workflows The GitHub workflows currently reference
Upgrading all instances to the latest version will improve consistency and compatibility across your workflows. Please update these references accordingly. 🧰 Tools🪛 actionlint (1.7.4)620-620: the runner of "dorny/paths-filter@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||
- name: List all changed files tracked and untracked files | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
- name: List changed files | ||
if: steps.filter-changed-files.outputs.go == 'true' | ||
run: | | ||
echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}" | ||
echo "Go files have been changed" | ||
|
||
# Fail if files need regeneration | ||
# TODO: this can run into a bit of a race condition if any other label is removed/added while this is run, look into fixing this by dispatching another workflow | ||
- name: Add Label | ||
if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed == 'true' }} | ||
if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.filter-changed-files.outputs.go == 'true' }} | ||
uses: ./.github/actions/add-label | ||
with: | ||
label: 'needs-go-generate-${{matrix.package}}' | ||
|
||
- name: Remove Label | ||
if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} | ||
if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.filter-changed-files.outputs.go != 'true' }} | ||
uses: ./.github/actions/remove-label | ||
with: | ||
label: 'needs-go-generate-${{matrix.package}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
❓ Verification inconclusive
Update dorny/paths-filter Version for Solidity Changes
The step for checking Solidity file changes uses
dorny/paths-filter@v2
, which static analysis flagged as outdated. Consider upgrading to a newer version (e.g. v3) to ensure compatibility and improved performance on GitHub Actions.Action Required: Upgrade dorny/paths-filter Version in Workflow
In
.github/workflows/go.yml
at lines 56–60, the workflow currently uses:Static analysis indicates that version 2 is outdated for handling recent Solidity file changes. Upgrading to
dorny/paths-filter@v3
should improve compatibility and performance on GitHub Actions. Please update the version accordingly. For example:🧰 Tools
🪛 actionlint (1.7.4)
56-56: the runner of "dorny/paths-filter@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)