Skip to content

Commit

Permalink
ci: Automatically prepend CC to GH PR title
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Nov 13, 2023
1 parent 58da187 commit 3eb3b22
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/cc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches:
- main
pull_request:
name: Conventional Commits
jobs:
cc:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: cashapp/activate-hermit@v1
- name: Update PR title
run: |
orig="${{ github.event.pull_request.title }}"
modified="$(gptcc "$orig")"
diff -u <(echo "$orig") <(echo "$modified") | tail +4 || true
gh pr edit --title "$modified"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
1 change: 1 addition & 0 deletions bin/.gptcc-0.0.1.pkg
1 change: 1 addition & 0 deletions bin/gptcc

0 comments on commit 3eb3b22

Please sign in to comment.