You've already forked wakapi-readme-stats
hiding outdated comments
This commit is contained in:
3
.github/workflows/review_pr.yml
vendored
3
.github/workflows/review_pr.yml
vendored
@@ -2,7 +2,7 @@ name: REVIEW_PULL_REQUEST
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [ review_requested ]
|
||||
types: [ opened, edited, reopened, synchronize ]
|
||||
paths:
|
||||
- 'sources/**'
|
||||
- 'requirements.txt'
|
||||
@@ -15,7 +15,6 @@ concurrency:
|
||||
jobs:
|
||||
publish-server-image:
|
||||
name: Run Test and Review PR
|
||||
if: ${{ github.event.requested_reviewer.login == 'anmol098'}}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
@@ -4,6 +4,7 @@ from re import sub
|
||||
from github import Github, AuthenticatedUser, Repository, ContentFile, InputGitAuthor, UnknownObjectException
|
||||
|
||||
from manager_environment import EnvironmentManager as EM
|
||||
from manager_download import DownloadManager as DM
|
||||
from manager_debug import DebugManager as DBM
|
||||
|
||||
|
||||
@@ -109,9 +110,14 @@ class GitHubManager:
|
||||
|
||||
:param stats: Readme stats to be pushed.
|
||||
"""
|
||||
prefix = "README stats current output:\n\n"
|
||||
DBM.i("Commenting PR...")
|
||||
|
||||
pull_request = GitHubManager._GITHUB.get_repo("anmol098/waka-readme-stats").get_pull(EM.PR_NUMBER)
|
||||
pull_request.create_issue_comment(stats)
|
||||
for comment in [ic for ic in pull_request.get_issue_comments() if ic.body.startswith(prefix)]:
|
||||
DM.get_remote_graphql("hide_outdated_comment", id=comment.id)
|
||||
|
||||
pull_request.create_issue_comment(f"{prefix}{stats}")
|
||||
DBM.g("PR commented!")
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user