-
Notifications
You must be signed in to change notification settings - Fork 0
Fix the workflows #427
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
Fix the workflows #427
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,24 @@ | ||
| name: dependabot-auto-merge | ||
| name: auto-merge | ||
|
Contributor
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. Consider keeping the workflow name as 'dependabot-auto-merge' since it more specifically describes its primary purpose of handling Dependabot PRs. |
||
|
|
||
| on: | ||
| pull_request_target: | ||
| on: pull_request | ||
|
Contributor
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. 🛑 Security Risk: Changing from Footnotes
|
||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| auto-merge: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| if: github.actor == 'dependabot[bot]' | ||
| if: github.event.pull_request.draft == false | ||
|
|
||
|
Contributor
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. The condition |
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: ahmadnassri/action-dependabot-auto-merge@v2 | ||
| with: | ||
| github-token: ${{ secrets.PERSONAL_TOKEN_FOR_GITHUB_ACTIONS }} | ||
| config: .github/dependabot-auto-merge.yml | ||
|
|
||
| - name: Slack Notification (not success) | ||
| uses: lazy-actions/slatify@master | ||
| if: "! success()" | ||
| continue-on-error: true | ||
| with: | ||
| job_name: '*auto-merge*' | ||
| type: ${{ job.status }} | ||
| icon_emoji: ":octocat:" | ||
| url: ${{ secrets.SLACK_WEBHOOK }} | ||
| token: ${{ secrets.PERSONAL_TOKEN_FOR_GITHUB_ACTIONS }} | ||
| - name: Enable auto-merge for Pull Request | ||
| run: | | ||
| gh pr review --approve "$PR_URL" | ||
| gh pr merge --auto --squash "$PR_URL" | ||
| env: | ||
| PR_URL: ${{github.event.pull_request.html_url}} | ||
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
Contributor
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. Consider retaining the Slack notification for failed auto-merges as it provides valuable monitoring capabilities for the automation process. |
||
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.
🛑 Security Risk: Removing the permissions block from the CI workflow removes the principle of least privilege. GitHub Actions workflows should explicitly define minimum required permissions1.
Footnotes
CWE-250: Execution with Unnecessary Privileges - https://cwe.mitre.org/data/definitions/250.html ↩