🔧 Fix: Comprehensive GitHub token integration for all Docker workflows
All checks were successful
Security & Dependency Updates / Dependency Security Scan (push) Successful in 23s
Security & Dependency Updates / Docker Security Scan (push) Successful in 1m27s
Security & Dependency Updates / License Compliance (push) Successful in 12s
Security & Dependency Updates / Check for Dependency Updates (push) Successful in 16s
Security & Dependency Updates / Code Quality Metrics (push) Successful in 9s
Security & Dependency Updates / Security Summary (push) Successful in 6s

 Complete GitHub Token Support:
- Add github-token parameter to all Trivy actions (security + release)
- Add GITHUB_TOKEN environment variable to all Docker build steps
- Add global GITHUB_TOKEN environment to CI and release workflows
- Ensure consistent token usage across all workflow jobs

🐳 Docker Workflow Improvements:
- CI workflow: Docker build with GitHub token for base image pulls
- Security workflow: Docker build + Trivy scans with token
- Release workflow: Docker build + security scans with token
- Better authentication for all container operations

 Authentication Benefits:
- Eliminates GitHub API rate limiting issues
- Fixes 'Bad credentials' errors in Trivy scans
- Improves reliability of Docker base image pulls
- Ensures consistent authentication across all workflows

 Affected Workflows:
- CI/CD Pipeline: Enhanced Docker builds
- Security Scans: Fixed Trivy authentication
- Release Pipeline: Complete token integration
This commit is contained in:
2025-08-12 16:26:02 +07:00
parent 557b29b74d
commit b13a4fe400
3 changed files with 362 additions and 331 deletions

View File

@@ -15,6 +15,8 @@ env:
PYTHON_VERSION: '3.11'
REGISTRY: git.b4l.co.th
IMAGE_NAME: b4l/northern-thailand-ping-river-monitor
# GitHub token for better rate limits and authentication
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
# Create release
@@ -139,6 +141,8 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Security scan for release
security-scan:
@@ -156,6 +160,7 @@ jobs:
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create-release.outputs.version }}
format: 'sarif'
output: 'trivy-results.sarif'
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}