RedRover Generate Standards #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: RedRover Generate Standards | |
on: | |
schedule: | |
- cron: "0 0 1 * *" | |
workflow_dispatch: | |
jobs: | |
fetch-pr-diff-urls: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Cache Python dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('red_rover/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r red_rover/requirements.txt | |
- name: Generate Standards | |
run: python red_rover/generate_standards.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
GITHUB_REPO: ${{ github.repository }} | |
- name: Get current date | |
id: date | |
run: | | |
echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M')" | |
echo "::set-output name=branch-date::$(date +'%Y-%m-%d_%H-%M')" | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: "Update Red Rover standards specific to this repo - ${{ steps.date.outputs.date }}" | |
body: "Some notes about this automatically generated PR:\n | |
- These PRs are generated once a month using the 10 most recent PRs to update the standards specific to this repo.\n | |
- Red Rover uses these repo-specific standards during its PR reviews to provide better feedback.\n | |
- The Github action to generate this PR, RedRover Generate Standards, can also be run manually if desired.\n | |
- You can review the changes in this PR and determine if you want to use them or not." | |
branch: red-rover-standards-update-${{ steps.date.outputs.branch-date }} | |
- name: Post Pull Request URL | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |