Skip to content

Commit 487070b

Browse files
committed
fix: linting
- ensure credentials are not persisted past checkout of code - add zizmor.yml file to allow pull_request_target in actions for auto-labeler to work on fork pull requests - add HEALTHCHECK and non-root user to Dockerfile Signed-off-by: jmeridth <jmeridth@gmail.com>
1 parent ca65fb2 commit 487070b

File tree

6 files changed

+19
-0
lines changed

6 files changed

+19
-0
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
steps:
2828
- name: Checkout code
2929
uses: actions/checkout@v5.0.0
30+
with:
31+
persist-credentials: false
3032

3133
- name: Set up Python
3234
uses: actions/setup-python@v5.6.0

.github/workflows/docker-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v5.0.0
18+
with:
19+
persist-credentials: false
1820
- name: Build the Docker image
1921
run: docker build . --file Dockerfile --platform linux/amd64

.github/workflows/python-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
python-version: [3.11, 3.12]
2222
steps:
2323
- uses: actions/checkout@v5.0.0
24+
with:
25+
persist-credentials: false
2426
- name: Set up Python ${{ matrix.python-version }}
2527
uses: actions/setup-python@v5.6.0
2628
with:

.github/workflows/super-linter.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: actions/checkout@v5.0.0
2222
with:
2323
fetch-depth: 0
24+
persist-credentials: false
2425
- name: Install dependencies
2526
run: |
2627
python -m pip install --upgrade pip

.github/zizmor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rules:
2+
dangerous-triggers: # to allow pull_request_target for auto-labelling fork pull requests
3+
disable: true

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ RUN python3 -m pip install --no-cache-dir -r requirements.txt \
1919
&& apt-get -y update \
2020
&& apt-get -y install --no-install-recommends git=1:2.47.3-0+deb13u1 \
2121
&& rm -rf /var/lib/apt/lists/*
22+
&& adduser --system --ingroup appuser --home /action/workspace --disabled-login appuser \
23+
&& chown -R appuser:appuser /action/workspace
24+
25+
# Run the action as a non-root user
26+
USER appuser
27+
28+
# Add a simple healthcheck to satisfy container scanners
29+
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
30+
CMD python3 -c "import os,sys; sys.exit(0 if os.path.exists('/action/workspace/contributors.py') else 1)"
2231

2332
CMD ["/action/workspace/contributors.py"]
2433
ENTRYPOINT ["python3", "-u"]

0 commit comments

Comments
 (0)