A GitHub Workflow that automatically answers the following questions on closed/merged Pull Requests.
-
How long was PR open?
-
Who contributed to the PR?
-
What files changed in the PR?
-
How many lines of code changed in the PR?
The following highlights how this workflow works.
- When a pull request is closed, the workflow is started.
- The workflow downloads the repo using the GitHub Action actions/checkout@v2
- The workflow uses the GitHub GraphQL API using the template query to get data on the pull request using the GitHub Action helaili/github-graphql-action@2.0.1
- The workflow saves the output as a JSON file
- The workflow uses the jannekem/run-python-script-action@v1 to parse the JSON file to set answers to the questions as environment variables
- The workflow uses the chuhlomin/render-template@v1.2 to set the answers into the PRFAQs template
- The workflow uses the peter-evans/create-or-update-comment@v1 to post the answers as a comment on the Pull Request
The following image is an example from here