Skip to content

sync-to-docs

sync-to-docs #697

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 }}