Skip to content

Remove ghalint workaround and fix all security policy violations #2208

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

Merged
merged 2 commits into from
Jun 26, 2025

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Remove ghalint workaround and fix all security policy violations

Summary

This PR removes the temporary workaround code from the ghalint workflow that was filtering to only check for action_ref_should_be_full_length_commit_sha violations, and comprehensively fixes all ghalint security policy violations across the GitHub Actions workflow files.

Changes Made

1. Removed Workaround Code

  • File: .github/workflows/ghalint.yml
  • Change: Replaced the complex filtering logic with a simple ghalint run command
  • Impact: ghalint now properly reports all security policy violations instead of hiding them

2. Fixed Security Policy Violations

Added persist-credentials: false to checkout actions

Enhanced security by preventing accidental credential exposure in the following workflows:

  • claude.yml
  • database-ci.yml
  • e2e_tests.yml
  • figma-to-css-variables.yml
  • frontend-ci.yml (3 jobs)
  • license-report-update.yml
  • license.yml
  • notify_supabase_failure.yml
  • released_package_test.yml
  • stale.yml
  • trigger_dev_preview.yml
  • trigger_dev_production.yml

Added proper job permissions

Implemented least-privilege access by adding permissions: contents: read to jobs that were missing them:

  • claude.yml - claude-code-action job
  • database-ci.yml - pg_tap_tests job
  • discussion-comment-to-slack.yml - discussion_commented job
  • frontend-ci.yml - frontend-lint and frontend-ci jobs
  • license.yml - license_finder job
  • notify_supabase_failure.yml - notify_slack job
  • released_package_test.yml - test job
  • trigger_dev_preview.yml - trigger_dev job
  • trigger_dev_production.yml - trigger_dev job

Added missing timeout configurations

Added timeout-minutes: 10 to jobs that were missing them:

  • claude.yml - claude-code-action job
  • notify_supabase_failure.yml - notify_slack job
  • stale.yml - stale job

Fixed GitHub App token permissions

Updated GitHub App token creation to use proper permission format:

  • license-report-update.yml - Added permission-contents: write and permission-pull-requests: write
  • release.yml - Added permission-contents: write, permission-pull-requests: write, and permission-actions: write

Testing

Local ghalint verification: Ran ghalint run locally and confirmed all violations are resolved (exit code 0)

Security improvements verified: All changes follow GitHub Actions security best practices:

  • Checkout actions now use persist-credentials: false to prevent credential leakage
  • Jobs have explicit permissions following least-privilege principle
  • Timeout specifications prevent runaway processes
  • GitHub App tokens specify explicit permissions

Testing Transparency

What I Actually Checked

  • ✅ Downloaded and ran ghalint v1.5.1 locally to verify all policy violations are fixed
  • ✅ Verified the workaround code was completely removed from ghalint.yml
  • ✅ Confirmed all checkout actions now include persist-credentials: false
  • ✅ Verified all jobs have appropriate permission blocks
  • ✅ Checked that GitHub App token permissions use the correct format

What I Did Not Check

  • ❌ Did not run the full pnpm lint command due to environment dependency issues (unrelated to these changes)
  • ❌ Did not test the actual functionality of individual workflows (will be verified by CI)
  • ❌ Did not verify the specific permission requirements for each job beyond adding basic contents: read

Reviewer Checklist

Please verify:

  • The ghalint workflow now runs without filtering and properly fails on any violations
  • All checkout actions include persist-credentials: false
  • Job permissions are appropriate for each workflow's needs
  • GitHub App token permissions are correctly specified
  • CI passes, especially the updated ghalint workflow

Link to Devin run

https://app.devin.ai/sessions/f1784c3e07d74e548db665012f68f178

Requested by: [email protected]

- Remove workaround filtering logic from ghalint.yml that only checked action_ref_should_be_full_length_commit_sha
- Add persist-credentials: false to all checkout actions for enhanced security
- Add proper permissions blocks to jobs following least-privilege principle
- Add timeout-minutes to jobs missing them to prevent runaway processes
- Fix GitHub App token permissions format in license-report-update.yml and release.yml
- All ghalint policy violations now resolved across the entire codebase

Co-Authored-By: [email protected] <[email protected]>
Copy link

vercel bot commented Jun 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
liam-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2025 2:19am
liam-erd-sample ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2025 2:19am
liam-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2025 2:19am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
liam-docs ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2025 2:19am

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

changeset-bot bot commented Jun 25, 2025

⚠️ No Changeset found

Latest commit: 3da1909

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

supabase bot commented Jun 25, 2025

Updates to Preview Branch (devin/1750848019-remove-ghalint-workaround) ↗︎

Deployments Status Updated
Database Thu, 26 Jun 2025 02:16:12 UTC
Services Thu, 26 Jun 2025 02:16:12 UTC
APIs Thu, 26 Jun 2025 02:16:12 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Thu, 26 Jun 2025 02:16:12 UTC
Migrations Thu, 26 Jun 2025 02:16:12 UTC
Seeding Thu, 26 Jun 2025 02:16:12 UTC
Edge Functions Thu, 26 Jun 2025 02:16:12 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Comment on lines +31 to +32
permission-contents: write
permission-pull-requests: write
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed GitHub App token permissions

Updated GitHub App token creation to use proper permission format:

  • license-report-update.yml - Added permission-contents: write and permission-pull-requests: write
  • release.yml - Added permission-contents: write, permission-pull-requests: write, and permission-actions: write

Oh, this was added automatically based on some heuristic or something, right?
Pretty cool — how does it even figure that out, Devin?

Copy link
Member

@hoshinotsuyoshi hoshinotsuyoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure if the Fixed GitHub App token permissions change is the bare minimum, but it doesn’t seem critical anyway. so LGTM!

@@ -31,6 +32,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
persist-credentials: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref: https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/013.md
Making the token persistent allows subsequent steps such as git push.For security risk, it should be false if not needed.

Copy link

coderabbitai bot commented Jun 26, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member

@MH4GF MH4GF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀🚀

@MH4GF MH4GF enabled auto-merge June 26, 2025 02:15
@MH4GF MH4GF added this pull request to the merge queue Jun 26, 2025
Merged via the queue into main with commit 9c9d407 Jun 26, 2025
28 checks passed
@MH4GF MH4GF deleted the devin/1750848019-remove-ghalint-workaround branch June 26, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants