Skip to content

Commit f979525

Browse files
fix(security): Update track-modules job (#787)
This will address the Security issue reported on #786 As recommended, `tj-actions/changed-files` was replace replaced with [path-filter](https://github.com/dorny/paths-filter) --------- Co-authored-by: David Ankin <daveankin@gmail.com>
1 parent a0785d7 commit f979525

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/workflows/ci-community.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ jobs:
1919
- name: Checkout contents
2020
uses: actions/checkout@v4
2121
with:
22-
fetch-depth: 0 # recommended by tj-actions/changed-files
22+
fetch-depth: 0
2323
- name: Get changed files
2424
id: changed-files
25-
uses: tj-actions/changed-files@v42
25+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
2626
with:
27-
path: "./modules"
28-
diff_relative: true
29-
dir_names: true
30-
dir_names_exclude_current_dir: true
31-
json: true
27+
base: ${{ github.ref }}
28+
list-files: 'json'
29+
filters: |
30+
modules:
31+
- 'modules/**'
3232
- name: Compute modules from files
3333
id: compute-changes
3434
run: |
35-
modules=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | jq '.[] | split("/") | first' | jq -s -c '. | unique')
35+
modules=$(echo "${{ toJson(steps.changed-files.outputs.modules_files) }}" | jq '.[] | split("/") | nth(1)' | jq -s -c '. | unique')
3636
echo "computed_modules=$modules"
3737
echo "computed_modules=$modules" >> $GITHUB_OUTPUT
3838
outputs:

modules/aws/testcontainers/aws/aws_lambda.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
RIE_PATH = "/2015-03-31/functions/function/invocations"
1010
# AWS OS-only base images contain an Amazon Linux distribution and the runtime interface emulator (RIE) for Lambda.
1111

12+
# This comment can be removed (Used for testing)
13+
1214

1315
class AWSLambdaContainer(ServerContainer):
1416
"""

modules/generic/testcontainers/generic/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from testcontainers.core.image import DockerImage
1010
from testcontainers.core.waiting_utils import wait_container_is_ready
1111

12+
# This comment can be removed (Used for testing)
13+
1214

1315
class ServerContainer(DockerContainer):
1416
"""

0 commit comments

Comments
 (0)