-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow to trigger github workflow manually #68
Conversation
WalkthroughThe pull request introduces updates to three GitHub workflow configuration files: Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Workflow
User->>Workflow: Trigger workflow (manual)
Workflow->>Workflow: Execute jobs
Workflow->>User: Return results
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #68 +/- ##
=======================================
Coverage 84.93% 84.93%
=======================================
Files 28 28
Lines 3909 3909
Branches 3909 3909
=======================================
Hits 3320 3320
Misses 399 399
Partials 190 190 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
.github/workflows/coverage.yml (1)
12-12
: LGTM! Consider documenting trigger permissions.The addition of
workflow_dispatch
trigger is well-placed and follows GitHub Actions best practices. This change successfully enables manual workflow execution while maintaining compatibility with existing automated triggers.Consider documenting who can manually trigger this workflow in the repository's documentation. By default, users with write access to the repository can trigger manual workflows.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
.github/workflows/coverage.yml
(1 hunks).github/workflows/main.yml
(1 hunks).github/workflows/pr-checks.yml
(1 hunks)
🔇 Additional comments (2)
.github/workflows/pr-checks.yml (1)
6-6
: LGTM! The workflow_dispatch trigger is correctly configured.
The addition of the workflow_dispatch
trigger allows for manual execution of the workflow while maintaining the existing pull request trigger functionality.
.github/workflows/main.yml (1)
11-11
: LGTM! Manual trigger capability added correctly.
The addition of workflow_dispatch
event is properly configured, allowing manual execution of the workflow while preserving existing automated triggers.
Let's verify the consistency of manual triggers across all workflow files:
✅ Verification successful
Manual trigger capability consistently added across all workflow files ✅
The verification confirms that workflow_dispatch
trigger has been properly added to all GitHub workflow files:
.github/workflows/coverage.yml
.github/workflows/main.yml
.github/workflows/pr-checks.yml
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that workflow_dispatch is added consistently across workflow files
# Expected: All workflow files mentioned in the summary should have workflow_dispatch trigger
# Check all workflow files for workflow_dispatch trigger
echo "Checking workflow files for manual trigger configuration..."
for file in .github/workflows/{coverage,main,pr-checks}.yml; do
echo "=== $file ==="
rg -A 2 "on:|workflow_dispatch" "$file"
done
Length of output: 1947
@@ -3,6 +3,7 @@ name: Mandatory Pull Request Checks | |||
on: | |||
pull_request: | |||
branches: [ "main" ] | |||
workflow_dispatch: |
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.
💡 Codebase verification
Add permissions configuration to pr-checks.yml workflow
The workflow file pr-checks.yml
lacks a permissions
configuration block, unlike main.yml
which properly defines its permissions. Add a minimal permissions block to explicitly restrict the workflow's access:
permissions: read-all
- Add this block right after the
on:
section in.github/workflows/pr-checks.yml
This ensures the workflow only has read access by default, which is sufficient for PR checks like building, testing, and linting. The workflow_dispatch
trigger will inherit these permissions, preventing potential misuse of elevated privileges during manual runs.
🔗 Analysis chain
Consider configuring permissions for manual workflow triggers.
To prevent potential abuse of CI resources, ensure that appropriate permissions are configured for who can manually trigger this workflow.
Let's check the repository's workflow permissions:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check workflow permissions configuration in the repository
# Check for workflow permissions in repository settings
gh api repos/{owner}/{repo}/actions/permissions
# Check for environment protection rules that might affect workflow execution
gh api repos/{owner}/{repo}/environments
# Look for any existing permissions configurations in workflow files
rg -l "permissions:" .github/workflows/
Length of output: 438
Script:
#!/bin/bash
# Let's check the content of both workflow files to see their permissions configuration
cat .github/workflows/main.yml
cat .github/workflows/pr-checks.yml
Length of output: 2758
Summary by CodeRabbit
New Features
Bug Fixes
Documentation