-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.34 KB
/
merge-pr.yml
File metadata and controls
44 lines (40 loc) · 1.34 KB
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
name: merge pr
concurrency: staging
on:
pull_request:
branches:
- 'main'
types:
- closed
permissions:
pull-requests: write
jobs:
if_merged:
# this workflow should not run on forks
if: |
github.repository == 'lexical-cloud/lexical-cloud-data-hugo' &&
github.event.pull_request.merged == true
runs-on: ubuntu-22.04
steps:
- name: Checkout project with submodules
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout branch for pr on public submodule
id: checkout-public-pr-branch
run: |
cd public
echo "head-commit-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
git checkout deploy/hugo-pr-$PR_NUM
echo "branch-commit-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
continue-on-error: true
env:
PR_NUM: ${{ github.event.pull_request.number }}
PR_URL: ${{ github.event.pull_request.html_url }}
- name: Reminder to complete pr to lexical-cloud-data
if: |
steps.checkout-public-pr-branch.outputs.branch-commit-sha != '' &&
steps.checkout-public-pr-branch.outputs.head-commit-sha != steps.checkout-public-pr-branch.outputs.branch-commit-sha
run: exit 1