-
Notifications
You must be signed in to change notification settings - Fork 58
69 lines (66 loc) · 2.17 KB
/
pr-subtree-push.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: "PR Subtree Push"
permissions:
contents: write
on:
pull_request_target:
branches:
- main
types: [closed]
jobs:
split-subtrees:
if: ${{ github.event.pull_request.merged }}
runs-on: macos-13
name: Split and Push Subtrees
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Setup SSH Keys
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: |
${{ secrets.APOLLO_IOS_DEPLOY_KEY }}
${{ secrets.APOLLO_IOS_CODEGEN_DEPLOY_KEY }}
${{ secrets.APOLLO_IOS_DEV_DEPLOY_KEY }}
${{ secrets.APOLLO_IOS_PAGINATION_DEPLOY_KEY }}
- name: Configure Git
uses: ./.github/actions/configure-git
- name: Update Merge Commit Message
shell: bash
run: |
git commit --allow-empty --amend -m "${{ github.event.pull_request.title }} (apollographql/apollo-ios-dev#${{ github.event.pull_request.number }})"
git push --force-with-lease
- name: Subtree - Apollo iOS
uses: ./.github/actions/subtree-split-push
with:
subtree: apollo-ios
remote: git@github.com:apollographql/apollo-ios.git
target-branch: main
pr-number: ${{ github.event.pull_request.number }}
pr-title: ${{ github.event.pull_request.title }}
- name: Subtree - Apollo iOS Codegen
if: always()
uses: ./.github/actions/subtree-split-push
with:
subtree: apollo-ios-codegen
remote: git@github.com:apollographql/apollo-ios-codegen.git
target-branch: main
pr-number: ${{ github.event.pull_request.number }}
pr-title: ${{ github.event.pull_request.title }}
- name: Subtree - Apollo iOS Pagination
if: always()
uses: ./.github/actions/subtree-split-push
with:
subtree: apollo-ios-pagination
remote: git@github.com:apollographql/apollo-ios-pagination.git
target-branch: main
pr-number: ${{ github.event.pull_request.number }}
pr-title: ${{ github.event.pull_request.title }}
- name: Push Updated History
if: always()
shell: bash
run: |
git fetch
git push