Skip to content

Update copy-md.yml

Update copy-md.yml #84

Workflow file for this run

name: Copy MD Files and Create PR
on:
workflow_dispatch:
schedule:
- cron: '0 0,12 * * *'
push:
jobs:
sync-docs-and-create-pr:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Checkout Sync-Branch
run: |
git fetch --all
git checkout sync-docs-branch
- name: Set Up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: |
yarn install --frozen-lockfile
- name: Run Sync Script
run: |
chmod +x sync_script.sh
./sync_script.sh
- uses: stefanzweifel/git-auto-commit-action@v4
if: always()
with:
commit_message: sync documentation changes
branch: sync-docs-branch
create_branch: false
file_pattern: '*.md'
disable_globbing: true
add_options: -A
run:
git status
git add .
- name: "Run if changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "Changes!"
- name: "Run if no changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: echo "No Changes!"
- name: Push Changes
run: git push origin sync-docs-branch
- name: View Git Diff
run: |
git fetch origin main
git diff -- origin/main
- name: Push Changes
run: git push origin sync-docs-branch
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
base: main
branch: sync-docs-branch
title: "Sync Documentation Changes"
body: "Automatically generated by GitHub Actions to sync documentation changes."