Skip to content

Commit 1e9af0f

Browse files
authored
Added action inputs (#8)
* Added action inputs * Updated documentation to include the PR Check variable * Updated actions.yml * Fixed Socket API Key detection in actions * Fix config precedence for API to overide Env vars
1 parent d33ea17 commit 1e9af0f

File tree

11 files changed

+555
-93
lines changed

11 files changed

+555
-93
lines changed

.hooks/version-check.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- docs/pre-commit-hook.md (Docker build tags)
1212
1313
Pattern matching:
14-
- GitHub Actions: SocketDev/socket-basics@vX.X.X -> @vNEW_VERSION
14+
- GitHub Actions: SocketDev/socket-basics@X.X.X -> @NEW_VERSION (no v prefix)
1515
- Docker builds: docker build -t IMAGE_NAME -> docker build -t IMAGE_NAME:NEW_VERSION
1616
1717
Usage:
@@ -39,8 +39,8 @@
3939

4040
VERSION_PATTERN = re.compile(r"__version__\s*=\s*['\"]([^'\"]+)['\"]")
4141
PYPROJECT_PATTERN = re.compile(r'^version\s*=\s*"([^"]+)"$', re.MULTILINE)
42-
# Pattern to match SocketDev/socket-basics@vX.X.X or @vX.X.X
43-
ACTION_VERSION_PATTERN = re.compile(r'(SocketDev/socket-basics|socket-basics)@v\d+\.\d+\.\d+')
42+
# Pattern to match SocketDev/socket-basics@X.X.X or @X.X.X (without v prefix)
43+
ACTION_VERSION_PATTERN = re.compile(r'(SocketDev/socket-basics|socket-basics)@v?\d+\.\d+\.\d+')
4444
# Pattern to match docker build with optional version tag (handles both new and existing tags)
4545
DOCKER_BUILD_PATTERN = re.compile(r'docker build (?:--platform [^\s]+ )?-t ([^\s:]+)(?::\d+\.\d+\.\d+)?')
4646
# Pattern to match docker run commands with version tags
@@ -117,8 +117,8 @@ def update_readme_versions(version: str):
117117
content = readme_file.read_text()
118118
original_content = content
119119

120-
# Update action version references (SocketDev/socket-basics@vX.X.X)
121-
content = ACTION_VERSION_PATTERN.sub(rf'\1@v{version}', content)
120+
# Update action version references (SocketDev/socket-basics@X.X.X without v prefix)
121+
content = ACTION_VERSION_PATTERN.sub(rf'\1@{version}', content)
122122

123123
# Update docker build commands to include version tag
124124
def docker_build_replacement(match):

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v4
2424

2525
- name: Run Socket Basics
26-
uses: SocketDev/socket-basics@v1.0.4
26+
uses: SocketDev/socket-basics@1.0.9
2727
with:
2828
github_token: ${{ secrets.GITHUB_TOKEN }}
2929
socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }}
@@ -106,7 +106,7 @@ Configure scanning policies, notification channels, and rule sets for your entir
106106

107107
**Dashboard-Configured (Enterprise):**
108108
```yaml
109-
- uses: SocketDev/socket-basics@v1.0.4
109+
- uses: SocketDev/socket-basics@1.0.9
110110
with:
111111
github_token: ${{ secrets.GITHUB_TOKEN }}
112112
socket_security_api_key: ${{ secrets.SOCKET_SECURITY_API_KEY }}
@@ -115,7 +115,7 @@ Configure scanning policies, notification channels, and rule sets for your entir
115115

116116
**CLI-Configured:**
117117
```yaml
118-
- uses: SocketDev/socket-basics@v1.0.4
118+
- uses: SocketDev/socket-basics@1.0.9
119119
with:
120120
github_token: ${{ secrets.GITHUB_TOKEN }}
121121
python_sast_enabled: 'true'
@@ -129,10 +129,10 @@ Configure scanning policies, notification channels, and rule sets for your entir
129129

130130
```bash
131131
# Build with version tag
132-
docker build -t socketdev/socket-basics:1.0.4 .
132+
docker build -t socketdev/socket-basics:1.0.9 .
133133
134134
# Run scan
135-
docker run --rm -v "$PWD:/workspace" socketdev/socket-basics:1.0.4 \
135+
docker run --rm -v "$PWD:/workspace" socketdev/socket-basics:1.0.9 \
136136
--workspace /workspace \
137137
--python-sast-enabled \
138138
--secret-scanning-enabled \
@@ -249,11 +249,6 @@ We welcome contributions! To add new features:
249249
3. **Configuration:** Add entries to `socket_basics/connectors.yaml` or `socket_basics/notifications.yaml`
250250
4. **Tests:** Add test cases to `app_tests/`
251251

252-
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
253-
254-
## 📝 License
255-
256-
This project is licensed under the terms specified in the [LICENSE](LICENSE) file.
257252

258253
---
259254

0 commit comments

Comments
 (0)