-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(deps)!: Update GitHub Actions (major) #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -61,10 +61,10 @@ jobs: | |||||||||
| egress-policy: audit | ||||||||||
|
|
||||||||||
| - name: Checkout repository | ||||||||||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||||||||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Find and examine the workflow file
find . -path "./.github/workflows/pr-validation.yml" -type fRepository: ByronWilliamsCPA/python-libs Length of output: 110 🏁 Script executed: # Read the workflow file to see the context around line 64
cat -n .github/workflows/pr-validation.yml | head -80Repository: ByronWilliamsCPA/python-libs Length of output: 3282 🏁 Script executed: # Check the entire workflow for any authenticated git operations
cat -n .github/workflows/pr-validation.yml | tail -20Repository: ByronWilliamsCPA/python-libs Length of output: 971 🏁 Script executed: # Also check if there are any other checkout actions or git operations in this file
grep -n "git\|push\|commit\|credentials" .github/workflows/pr-validation.ymlRepository: ByronWilliamsCPA/python-libs Length of output: 331 Harden checkout by disabling credential persistence. This job executes repository code from pull requests; keep the GITHUB_TOKEN out of git config since no authenticated git operations are performed. Suggested hardening - name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| - name: Install UV | ||||||||||
| uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 | ||||||||||
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | ||||||||||
| with: | ||||||||||
| enable-cache: true | ||||||||||
|
|
||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
|
|
@@ -169,12 +169,12 @@ jobs: | |
| # export-type: env | ||
|
|
||
| - name: Authenticate to Google Cloud | ||
| uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed # v2 | ||
| uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3 | ||
| with: | ||
| credentials_json: ${{ secrets.GCP_SA_KEY_BASE64 }} | ||
|
|
||
|
Comment on lines
+172
to
175
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat .github/workflows/publish-artifact-registry.ymlRepository: ByronWilliamsCPA/python-libs Length of output: 8895 🏁 Script executed: cat .github/workflows/publish-artifact-registry.yml | head -200Repository: ByronWilliamsCPA/python-libs Length of output: 6976 🏁 Script executed: cat .github/workflows/publish-artifact-registry.ymlRepository: ByronWilliamsCPA/python-libs Length of output: 8895 🌐 Web query:
💡 Result: The credentials_json input for the google-github-actions/auth GitHub Action expects the raw content of a Google Cloud Service Account Key JSON file [1][2]. To use this input correctly: 1. Format: The value must be the valid JSON object exported from the Google Cloud Console for a Service Account [2]. 2. Storage: It is strongly recommended to store this JSON as a GitHub Actions Secret [1][2]. 3. Best Practice: The documentation advises minifying the JSON into a single-line string before saving it as a GitHub Secret [1]. This prevents issues where GitHub Actions might aggressively sanitize or mask characters (such as curly braces or brackets) if the secret contains multiple lines [1]. 4. Usage in YAML: Reference the secret in your workflow file as follows [1][2]: - uses: 'google-github-actions/auth@v3' with: credentials_json: '${{ secrets.YOUR_SECRET_NAME }}' Important Security Note: Google and the maintainers of google-github-actions/auth strongly prefer using Workload Identity Federation over Service Account Key JSONs [1][3][4]. Workload Identity Federation eliminates the need for long-lived keys, which are a significant security risk if compromised [3][4]. If you must use credentials_json, ensure the service account has the roles/iam.serviceAccountTokenCreator role on itself [1][2]. Citations:
Fix credentials_json to receive raw JSON, not base64-encoded. The Store the raw JSON key (minified) as a separate secret (e.g., 🤖 Prompt for AI Agents |
||
| - name: Set up Cloud SDK | ||
| uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f # v2 | ||
| uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3 | ||
|
|
||
| - name: Configure Artifact Registry authentication | ||
| env: | ||
|
|
@@ -190,7 +190,7 @@ jobs: | |
| echo "📦 Registry URL: $AR_URL" | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4 | ||
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | ||
| with: | ||
| version: ${{ env.UV_VERSION }} | ||
| enable-cache: true | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n .github/workflows/ci.yml | head -250Repository: ByronWilliamsCPA/python-libs
Length of output: 9248
Disable persisted Git credentials in all PR-executed checkout actions.
Lines 45, 74, 122, 166, and 191 perform
checkoutinpull_requestworkflows. Since none of the subsequent steps require authenticated git operations, addpersist-credentials: falseto each checkout action to follow the principle of least privilege and reduce attack surface.Required changes
- name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: falseApply this change to lines 45, 74, 122, 166, and 191.
🤖 Prompt for AI Agents