Skip to content

Conversation

cfc4n
Copy link
Member

@cfc4n cfc4n commented Oct 12, 2025

This pull request updates the pr_build_debug.yml GitHub Actions workflow to improve security and reliability. The most important changes are:

Permissions and Security:

  • Changed the contents permission from write to read and added actions: read to limit the workflow’s access scope, following the principle of least privilege.

Workflow Reliability and Correctness:

  • Added a conditional to the "Comment PR with Download Links" job so it only runs for pull requests from the same repository, preventing issues with forks.
  • Explicitly set the github-token input for the actions/github-script step to ensure proper authentication.
  • Wrapped the comment creation in a try/catch block to log success or failure, improving error handling and debugging information.

fix: #852

@cfc4n cfc4n requested a review from Copilot October 12, 2025 09:33
@cfc4n cfc4n self-assigned this Oct 12, 2025
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 12, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the security and reliability of the GitHub Actions workflow for commenting on pull requests with debug build artifacts. It implements the principle of least privilege by reducing permissions and adds proper error handling.

  • Reduced workflow permissions from contents: write to contents: read and added actions: read
  • Added conditional check to prevent the comment job from running on forked PRs
  • Improved error handling with try/catch block and explicit token configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Oct 12, 2025
Copy link

🔧 Debug Build Complete (PR 853, RunID 18442172118)

📦 Download Links:

⏰ Files will be retained for 7 days, please download and test promptly.

@cfc4n cfc4n merged commit 7a5029d into master Oct 12, 2025
10 checks passed
@cfc4n cfc4n deleted the bugfix/workflow_post_comment branch October 12, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Actions: 403 Resource not accessible by integration when posting PR comment via actions/github-script@v7

1 participant