sync-to-docs #866
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/checkout@v4 | |
with: | |
path: destination | |
- name: Checkout source repo | |
uses: actions/checkout@v4 | |
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/setup-node@v4 | |
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@v6 | |
with: | |
body: ${{ env.BODY }} | |
branch: ${{ env.BRANCH_NAME }} | |
path: destination/ | |
reviewers: ${{ env.REVIEWERS }} | |
title: ${{ env.TITLE }} | |
token: ${{ secrets.GITHUB_TOKEN }} |