Skip to content

Commit

Permalink
♻️ Update Dockerfile to use CMD for passing GitHub Action inputs (#287)
Browse files Browse the repository at this point in the history
* ♻️ Update Dockerfile to use CMD for passing GitHub Action inputs

* ♻️ Use the entrypoint method of collecting inputs

As per the instructions here
  • Loading branch information
jasonBirchall authored Oct 29, 2024
1 parent 2f98b72 commit ccf9e3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion check-version-pinning/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ RUN pip install --no-cache-dir -r requirements.txt

COPY check_version_pinning.py /app/check_version_pinning.py

ENTRYPOINT ["python", "/app/check_version_pinning.py", "${{ inputs.workflow_directory }}", "${{ inputs.scan_mode }}"]
COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
2 changes: 2 additions & 0 deletions check-version-pinning/check_version_pinning.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,6 @@ def check_version_pinning(workflow_directory=".github/workflows", scan_mode="ful
if __name__ == "__main__":
workflow_directory = sys.argv[1] if len(sys.argv) > 1 else ".github/workflows"
scan_mode = sys.argv[2] if len(sys.argv) > 2 else "full"
print(f"Scan mode: {scan_mode}")

check_version_pinning(workflow_directory, scan_mode)
6 changes: 6 additions & 0 deletions check-version-pinning/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

WORKFLOW_DIRECTORY="${1:-.github/workflows}"
SCAN_MODE="${2:-full}"

python /app/check_version_pinning.py "$WORKFLOW_DIRECTORY" "$SCAN_MODE"

0 comments on commit ccf9e3a

Please sign in to comment.