You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It will be a great idea to add a workflow that checks the PRs
GitHub Actions workflow that automates the review process for pull requests (PRs) in our repository. The workflow will:
Check the PRs to determine if they are dev related or not. (based on some keyword or some parameters)
Automatically label the PRs as dev-related or non-dev-related.
Notify the maintainers when a dev-related PR is submitted for prompt review.
Sent/suggest a message if they are not dev related.
Workflow Details
Trigger
The workflow will trigger on the following pull request events: opened, edited, reopened.
Steps
Checkout Code: Use actions/checkout@v2 to check out the repository code.
Keyword Check: Run a script to check the PR title and description for specific dev-related keywords (e.g., dev, developer, frontend, backend, fullstack, programming, code).
Add Label: Use actions-ecosystem/action-add-labels@v1 to add a label (dev-related or non-dev-related) based on the keyword check result.
Notify Maintainers: If the PR is dev-related, send a notification comment to the PR to inform the maintainers for prompt review.
Example Workflow Configuration
name: PR Checkon:
pull_request:
types: [opened, edited, reopened]jobs:
check-pr:
runs-on: ubuntu-lateststeps:
- name: Checkout codeuses: actions/checkout@v2
- name: Check for dev-related keywordsid: keyword-checkrun: | keywords="dev,developer,frontend,backend,fullstack,programming,code" if echo "${{ github.event.pull_request.title }} ${{ github.event.pull_request.body }}" | grep -iE "$keywords"; then echo "::set-output name=is-dev-related::true" else echo "::set-output name=is-dev-related::false" fi
- name: Add label based on keyword checkuses: actions-ecosystem/action-add-labels@v1with:
github_token: ${{ secrets.GITHUB_TOKEN }}labels: ${{ steps.keyword-check.outputs.is-dev-related == 'true' && 'dev-related' || 'non-dev-related' }}
- name: Notify maintainersif: steps.keyword-check.outputs.is-dev-related == 'true'run: | curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -d '{"body": "A new dev-related PR has been submitted. Please review it at your earliest convenience."}' \ https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/commentsenv:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
The text was updated successfully, but these errors were encountered:
It will be a great idea to add a workflow that checks the PRs
GitHub Actions workflow that automates the review process for pull requests (PRs) in our repository. The workflow will:
dev-related
ornon-dev-related
.Workflow Details
Trigger
opened
,edited
,reopened
.Steps
actions/checkout@v2
to check out the repository code.dev
,developer
,frontend
,backend
,fullstack
,programming
,code
).actions-ecosystem/action-add-labels@v1
to add a label (dev-related
ornon-dev-related
) based on the keyword check result.Example Workflow Configuration
The text was updated successfully, but these errors were encountered: