You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "arpitjain099 (via GitHub)" <gi...@apache.org> on 2026/05/25 03:19:21 UTC

[PR] ci: declare workflow-level `contents: read` on 4 PR-time check workflows [doris]

arpitjain099 opened a new pull request, #63573:
URL: https://github.com/apache/doris/pull/63573

   Four PR-time check workflows (`clang-format`, `license-eyes`, `lfs-warning`, `title-checker`) just validate the PR or diff. No GitHub API writes from the workflows.
   
   **Note:** `.github/` appears to be in `.gitignore` for this repo, so I had to use `git add -f` to stage these. Happy to close if the gitignore is intentional and workflow files are managed via a different path.
   
   Same post-CVE-2025-30066 (`tj-actions/changed-files`) hardening pattern. YAML validated locally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare workflow-level `contents: read` on 4 PR-time check workflows [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4531216808

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR).
   
   Please clearly describe your PR:
   1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
   2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
   3. What features were added. Why was this function added?
   4. Which code was refactored and why was this part of the code refactored?
   5. Which functions were optimized and what is the difference before and after the optimization?
       


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare workflow-level `contents: read` on 4 PR-time check workflows [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4593153050

   Thanks for the PR! The security intent is correct and the change is minimal. However, after reviewing the actual source code of the actions used, **3 of the 4 workflows will break** with only `contents: read` declared:
   
   **`title-checker.yml` — breaks on every run**
   `deepakputhraya/action-pr-title` calls `client.rest.pulls.get()`, which requires `pull-requests: read`. With that permission implicitly set to `none`, every PR title check will 403.
   
   **`lfs-warning.yml` — breaks when a large file is detected**
   `ppremk/lfs-warning` calls `octokit.rest.issues.createComment()`, `issues.addLabels()`, and `pulls.listFiles()`, requiring `issues: write` + `pull-requests: read`. The workflow silently fails exactly when it matters most.
   
   **`license-eyes.yml` — breaks when a license violation is found**
   `apache/skywalking-eyes` uses the token to comment on the PR when violations are detected (documented in its `action.yml`). That needs `pull-requests: write`.
   
   **`clang-format.yml`** is fine — no token API calls involved.
   
   Suggested fix:
   ```yaml
   # title-checker.yml
   permissions:
     contents: read
     pull-requests: read
   
   # lfs-warning.yml
   permissions:
     contents: read
     pull-requests: read
     issues: write
   
   # license-eyes.yml
   permissions:
     contents: read
     pull-requests: write
   ```
   
   Only `clang-format.yml` is correct as-is. The other three need the scopes above to preserve existing behavior.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [chore](ci) declare least-privilege permissions on clang-format and title-checker workflows [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4646586142

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare workflow-level `contents: read` on 4 PR-time check workflows [doris]

Posted by "arpitjain099 (via GitHub)" <gi...@apache.org>.
arpitjain099 commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4541084464

   Hi, addressing the template prompt:
   
   1. **Problem**: Default `GITHUB_TOKEN` on the touched workflows was the repo-level default (typically `read/write` for issues/contents/etc), which is wider than the workflow actually uses. After CVE-2025-30066 (the March `tj-actions/changed-files` supply-chain compromise), the standard recommendation is to declare per-workflow least-privilege so an exfiltrated token has the smallest possible blast radius.
   
   2. **Behavior modified**: Four PR-time check workflows (`clang-format`, `license-eyes`, `lfs-warning`, `title-checker`) now declare a workflow-level `permissions: contents: read` block. Functionally nothing changes for callers - the workflows still read the PR diff and run their respective checks. The token they now hold is just bounded to `contents: read` rather than the repo-level default.
   
   3. **Features added**: None. This is hardening only.
   
   4. **Refactoring**: None. Three lines added per file (the `permissions` block); no logic touched.
   
   Side note: `.github/` is in this repo's `.gitignore`, so I had to use `git add -f` to stage the files. If you'd rather the workflow files be managed differently (e.g., generated from a template), happy to close.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare least-privilege permissions on clang-format and title-checker [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #63573:
URL: https://github.com/apache/doris/pull/63573#discussion_r3360811998


##########
.github/workflows/clang-format.yml:
##########
@@ -25,6 +25,10 @@ on:
   workflow_dispatch:
   issue_comment:
     types: [ created ]
+
+permissions:
+  contents: read

Review Comment:
   `dorny/paths-filter` determines changed files for `pull_request`/`pull_request_target` events by reading PR file metadata with the workflow token. Once this workflow-level block is added, every unspecified permission becomes `none`, so the `Paths filter` step no longer has `pull-requests: read` and PR clang-format checks can fail before deciding whether BE/Cloud files changed. Please keep least privilege but grant PR read access here as well.
   
   ```suggestion
     contents: read
     pull-requests: read
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [chore](ci) declare least-privilege permissions on clang-format and title-checker workflows [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4657834179

   /review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare workflow-level `contents: read` on 4 PR-time check workflows [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4591312431

   /review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare least-privilege permissions on clang-format and title-checker [doris]

Posted by "arpitjain099 (via GitHub)" <gi...@apache.org>.
arpitjain099 commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4597767369

   Thanks @hello-stephen, this is a great review. You traced the action sources exactly right, and you're correct that three of the four would have regressed.
   
   I have narrowed the PR rather than declaring the write scopes myself:
   
   - `clang-format.yml` keeps workflow-level `contents: read` (no token API calls, as you noted).
   - `title-checker.yml` now declares `contents: read` plus `pull-requests: read`, since `action-pr-title` calls `pulls.get()`. Both are read scopes, so nothing is granted write.
   - `lfs-warning.yml` and `license-eyes.yml` are dropped from this PR. Their actions write back to the PR (`issues: write` and `pull-requests: write` respectively), and I would rather not introduce write scopes from an outside contribution. They are easy to harden with the exact blocks you listed whenever a maintainer wants to:
   
   ```yaml
   # lfs-warning.yml
   permissions:
     contents: read
     pull-requests: read
     issues: write
   
   # license-eyes.yml
   permissions:
     contents: read
     pull-requests: write
   ```
   
   So this PR is now just the two safe, read-only declarations. Let me know if you'd prefer I fold the other two back in with those scopes instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare workflow-level `contents: read` on 4 PR-time check workflows [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #63573:
URL: https://github.com/apache/doris/pull/63573#discussion_r3333163037


##########
.github/workflows/lfs-warning.yml:
##########
@@ -20,6 +20,9 @@ name: 'Check Large File'
 
 on: [push, pull_request_target]
 
+permissions:
+  contents: read

Review Comment:
   This workflow still passes `secrets.GITHUB_TOKEN` to `ppremk/lfs-warning`, and that action is not read-only: it calls `issues.addLabels`, `issues.createComment`, `issues.removeLabel`, and may create the warning label. With a workflow-level `permissions` block, every unspecified scope is set to `none`, so `contents: read` removes the issue/label write permission that the large-file path depends on. A PR that adds a file over the limit will now fail with `Resource not accessible by integration` instead of adding the warning label/comment. Please keep least privilege but include the scopes this action needs, e.g. `pull-requests: read` plus `issues: write` (and `contents: read` for checkout/blob reads).



##########
.github/workflows/title-checker.yml:
##########
@@ -22,6 +22,9 @@ on:
   pull_request:
     types: [ opened, edited ]
 
+permissions:

Review Comment:
   `action-pr-title` uses the provided `github_token` to call `client.rest.pulls.get(...)` because it intentionally refreshes the PR title from the API. After adding a workflow-level permissions block, unspecified scopes are `none`, so this job no longer grants Pull Requests read permission to that API call. Please add `pull-requests: read` here (keeping `contents: read` if checkout still needs it) so title checks continue to work with least privilege.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare least-privilege permissions on clang-format and title-checker [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4628807485

   /review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [chore](ci) declare least-privilege permissions on clang-format and title-checker workflows [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow merged PR #63573:
URL: https://github.com/apache/doris/pull/63573


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [chore](ci) declare least-privilege permissions on clang-format and title-checker workflows [doris]

Posted by "arpitjain099 (via GitHub)" <gi...@apache.org>.
arpitjain099 commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4631520220

   Addressed both: added `pull-requests: read` to clang-format.yml (needed by dorny/paths-filter) and updated the PR title to the required `[chore](ci)` format. Should be green now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] ci: declare workflow-level `contents: read` on 4 PR-time check workflows [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on PR #63573:
URL: https://github.com/apache/doris/pull/63573#issuecomment-4591328396

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org