forked from Significant-Gravitas/AutoGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.51 KB
/
add-cassettes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Merge and Commit Cassettes
on:
pull_request_target:
types:
- closed
jobs:
update-cassettes:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # This is necessary to fetch all branches and tags
- name: Fetch all branches
run: git fetch --all
- name: Reset branch
run: |
git checkout ${{ github.event.pull_request.base.ref }}
git reset --hard origin/cassette-diff-${{ github.event.pull_request.head.sha }}
- name: Create PR
id: create_pr
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update cassettes
signoff: false
branch: cassette-diff-${{ github.event.pull_request.head.sha }}
delete-branch: false
title: "Update cassettes"
body: "This PR updates the cassettes."
draft: false
- name: Check PR
run: |
echo "Pull Request Number - ${{ steps.create_pr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.create_pr.outputs.pull-request-url }}"
- name: Comment PR URL in the current PR
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
New pull request created for cassettes: [HERE](${{ steps.create_pr.outputs.pull-request-url }}). Please merge it asap.