Skip to content

DOCS-4433: Add WeChat Pay Shopify app link to the Shopify document #948

DOCS-4433: Add WeChat Pay Shopify app link to the Shopify document

DOCS-4433: Add WeChat Pay Shopify app link to the Shopify document #948

Workflow file for this run

# This is a workflow to automatically generate diagram SVGs
name: Create mermaid diagrams
on:
# Run on pull requests into readmedocs-staging
pull_request:
types: [ closed ]
branches: [ master ]
# Enable manual triggers (for testing)
workflow_dispatch:
jobs:
create-diagrams:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
name: Create diagram SVGs
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v23
with:
sha: ${{ github.event.pull_request.head.sha }}
base_sha: ${{ github.event.pull_request.base.sha }}^
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file"
done
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Generate diagrams
run: |
npm install @mermaid-js/mermaid-cli
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
filename=$(basename "$file")
fname="${filename%.*}"
ext="${filename##*.}"
echo "file: $file ; filename: $filename ; fname: $fname ; ext: $ext"
if [ "$ext" = "mmd" ]
then
echo "$file with extension .mmd has changed"
npx mmdc -i $file -o static/diagrams/svg/${fname}.svg --configFile static/diagrams/config.json
fi
done
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
add-paths: static/diagrams/svg/*
labels: |
mermaid diagram
automated pr
base: master
draft: false
delete-branch: true
commit-message: Add mermaid diagram(s) [automated]
title: Add mermaid diagram(s) [automated]
branch: automated-diagrams
branch-suffix: short-commit-hash
delete-branch:
needs: create-diagrams
uses: ./.github/workflows/manual.yml
with:
branch: ${{ github.head_ref }}