Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
hogo6002 committed Jun 16, 2023
1 parent d74befc commit e19207e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/pr_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,15 @@ jobs:
repo: context.repo.repo,
body: '${{env.MESSAGE}}'
})
- name: Add labels for valid PR
if: env.IS_READY_FOR_MERGE == 'True'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Ready to merge']
})
13 changes: 8 additions & 5 deletions infra/pr_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def main():
pr_author = github.get_pr_author()
# Gets all modified projects path.
projects_path = github.get_projects_path()
email = github.get_author_email()
verified, email = github.get_author_email()

for project_path in projects_path:
project_url = f'{GITHUB_URL}/{OWNER}/{REPO}/tree/{BRANCH}/{project_path}'
Expand All @@ -100,10 +100,13 @@ def main():
if email:
if is_known_contributor(content_dict, email):
# Checks if the email is verified.
message += (
f'{pr_author} is either the primary contact or is in the CCs list '
f'of [{project_path}]({project_url}).<br/>')
continue
if verified:
message += (
f'{pr_author} (verified) is either the primary contact or '
f'is in the CCs list of [{project_path}]({project_url}).<br/>')
continue
message += (f'{pr_author} is either the primary contact or '
f'is in the CCs list of [{project_path}]({project_url})')

# Checks the previous commits.
commit_sha = github.has_author_modified_project(project_path)
Expand Down

0 comments on commit e19207e

Please sign in to comment.