-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.18 KB
/
auto_update_doc.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
name: Documents
on:
workflow_dispatch:
repository_dispatch:
types:
- Document
env:
GH_TOKEN: ${{ github.token }}
jobs:
update-document:
runs-on: ubuntu-latest
name: Create pull request
if: github.event.action == 'Document'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Create pull request
run: |
doc_branch=automation/task/update-rfw-documents
echo "Create pull request to merge documents"
pr_exists=$(gh pr list --state open | grep -qw "Auto-updated documents" && echo "found" || echo "not found")
if [ "$pr_exists" == "not found" ]; then
# Pull request not exist
echo "Pull request not found. Creating a new one..."
gh pr create \
--base develop --head $doc_branch \
--title "Auto-updated documents" \
--body "This PR was automatically generated by GitHub Actions to update documents" \
--assignee test-fullautomation \
--reviewer huavanthong \
--reviewer holque
else
echo "Pull request already exists. Skipping..."
fi