-
Notifications
You must be signed in to change notification settings - Fork 17
Add GitHub Actions workflows for automated PR review and linting #948
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
Conversation
|
is this related to #945? |
- Add lint.yml: automated code linting using super-linter - Add pr-automation.yml: team review assignment and 48h auto-approval - Add README.md: documentation for workflow setup and configuration - Workflows target both production and main branches - Auto-approval only occurs when status checks pass Co-authored-by: benrfairless <[email protected]>
.github/workflows/lint.yml
Outdated
| push: | ||
| branches: [ production, main ] | ||
| pull_request: | ||
| branches: [ production, main ] |
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.
Default branch is staging and production.
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.
Updated the lint workflow to use staging and production branches instead of main and production. Also updated the DEFAULT_BRANCH to staging. Changes in commit 122164a.
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.
This shouldn't apply to draft PRs
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.
Added conditions to exclude draft PRs from both team review assignment and auto-approval. Draft PRs will now be skipped by the automation workflows. Changes in commit 122164a.
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.
Update with changes from other comments.
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.
Updated the README.md to reflect the changes made in response to other comments:
- Updated branch references from
maintostaging - Added clarification that draft PRs are excluded from automation
- Added security note about draft PR exclusion
Changes in commit 122164a.
|
@copilot please see requested changes. |
- Change lint.yml branches from [production, main] to [staging, production] - Set DEFAULT_BRANCH to staging in lint workflow - Exclude draft PRs from team review assignment - Exclude draft PRs from auto-approval workflow - Update README.md to reflect branch changes and draft PR exclusions Co-authored-by: benrfairless <[email protected]>
All requested changes have been addressed:
The workflows now properly target the correct branches and exclude draft PRs from automation. Changes in commit 122164a. |
| # Full git history is needed to get a proper list of changed files within `super-linter` | ||
| fetch-depth: 0 |
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.
Why do we need this?
| fetch-depth: 0 | ||
|
|
||
| - name: Lint Code Base | ||
| uses: super-linter/super-linter@v5 |
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.
Not sure about this -- can we use a local linter instead, then it can be run in dev as well
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.
Sure, do you have a suggestion?
| uses: super-linter/super-linter@v5 | ||
| env: | ||
| DEFAULT_BRANCH: staging | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
not sure why we need a token, isn't it linting local files?
| name: Assign Team Reviewers | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'pull_request' && !github.event.pull_request.draft |
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.
isn't this achieving the same thing as the CODEOWNERS file?
This PR implements comprehensive automation for pull request management as requested in the issue.
Changes Made
1. Linting Automation (
lint.yml)stagingandproductionbranches2. PR Review Automation (
pr-automation.yml)openaustralia/team-right-to-knowteam as reviewers on all new PRs (excludes draft PRs)3. Documentation (
README.md)Security Features
Implementation Details
The solution uses GitHub Actions workflows exclusively, ensuring:
Next Steps
After merging, repository administrators should:
productionbranchopenaustralia/team-right-to-knowteam exists and has appropriate permissionsFixes #947.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.