-
Notifications
You must be signed in to change notification settings - Fork 249
56 lines (47 loc) · 1.97 KB
/
sync-and-process-files.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
name: sync and process files from another repo
on:
repository_dispatch:
types: [sync-to-docs]
jobs:
sync-and-process-files:
env:
# The body text of the PR requests that will be created
BODY: "Automated changes to pull in and process updates from repo: ${{ github.event.client_payload.repo }} ref: ${{ github.event.client_payload.ref }}"
# The name of the branch that will be created
BRANCH_NAME: automatic_docs_update/repo_${{ github.event.client_payload.repo }}/ref_${{ github.event.client_payload.ref }}
# The users that should be assigned to the PR as a comma separated list of github usernames.
REVIEWERS:
# The title of the PR request that will be created
TITLE: "Process changes to docs from: repo: ${{ github.event.client_payload.repo }} ref: ${{ github.event.client_payload.ref }}"
runs-on: ubuntu-latest
steps:
- name: Checkout destination
uses: actions/[email protected]
with:
path: destination
- name: Checkout source repo
uses: actions/[email protected]
with:
ref: ${{ github.event.client_payload.sha }}
repository: ${{ github.event.client_payload.repo }}
token: ${{ secrets.SYNC_FILES_TOKEN }}
path: source
- name: setup node
uses: actions/[email protected]
with:
node-version: "14"
- name: update npm
run: npm install -g npm@7
- name: Process changes
run: ${{ github.workspace }}/destination/scripts/source/dispatch_product.py ${{ github.event.client_payload.repo }} ${{ github.workspace }}
working-directory: source
- name: Create pull request
if: ${{ !env.ACT }}
uses: peter-evans/create-pull-request@v5
with:
body: ${{ env.BODY }}
branch: ${{ env.BRANCH_NAME }}
path: destination/
reviewers: ${{ env.REVIEWERS }}
title: ${{ env.TITLE }}
token: ${{ secrets.SYNC_FILES_TOKEN }}