Skip to content

Commit

Permalink
Updated actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbhagatio committed Aug 27, 2023
1 parent 747777b commit 2f2af11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/gpt_pr_review.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Reviews pull requests with OpenAI's GPT API.

name: gpt_pr_review
permissions:
contents: read
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/squash_merge_to_prod.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Squashe merges commits from PRs to 'main' into 'prod'. 'prod' thus serves as a more
# readable history of the project, while 'main' retains the full commit history.

name: squash_merge_to_prod
on:
push:
pull_request:
branches: [ main ]
types: [ closed ]
jobs:
squash_merge_to_prod:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true # only run if PR merged (subset of 'closed')
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -17,8 +22,7 @@ jobs:
- name: Merge and squash to prod
run: |
git checkout prod
# Get the latest commit message from the 'main' branch
COMMIT_MSG=$(git log main -1 --pretty=format:%s)
git merge --squash main
COMMIT_MSG=$(git log main -1 --pretty=format:%s) # latest commit message from 'main'
git merge --squash -X theirs main
git commit -m "$COMMIT_MSG"
git push origin prod

0 comments on commit 2f2af11

Please sign in to comment.