Skip to content

Commit

Permalink
Blog gen - Make PR fancier
Browse files Browse the repository at this point in the history
bradystroud committed Jan 30, 2025
1 parent 80629e5 commit 664c9a1
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/generate-blog-cron.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ on:
permissions:
contents: write
pull-requests: write

jobs:
generate-blog:
runs-on: ubuntu-latest
@@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.9"

- name: Install dependencies
run: |
@@ -34,10 +34,18 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: python scripts/generate_blog.py

- name: Extract blog title
id: extract_title
run: echo "BLOG_TITLE=$(sed -n 's/^title: //p' content/blogs/*.mdx | tr -d "'" | head -n 1)" >> $GITHUB_ENV

- name: Set unique branch name
id: set_branch
run: echo "BRANCH_NAME=new-blog-post-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Add new blog post"
title: "New Blog Post"
body: "This PR adds a new blog post generated by the GitHub Action."
branch: "new-blog-post"
commit-message: "Add new blog post - ${{ env.BLOG_TITLE }}"
title: "New blog post - ${{ env.BLOG_TITLE }}"
body: "This PR adds a new blog post generated by the GitHub Action using OpenAI API"
branch: "${{ env.BRANCH_NAME }}"

0 comments on commit 664c9a1

Please sign in to comment.