This repository has been archived by the owner on Feb 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
1,877 additions
and
144 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM neenjaw/mermaid:8.7.0 | ||
FROM neenjaw/mermaid:8.9.2 | ||
|
||
WORKDIR /mmdc | ||
COPY . /mmdc | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,15 @@ | |
|
||
## Purpose | ||
|
||
Markdown is a common way to present useful information with rich formatting from a simple human readable syntax. Especially useful is being able to highlight code blocks. | ||
Markdown is a common way to present useful information with rich formatting from a simple human readable syntax. Especially useful is being able to highlight code blocks. | ||
|
||
[Mermaid-JS](https://mermaid-js.github.io/mermaid/) takes this philosophy and applies it to graphs! Taking simple human-readable syntax and returning rich graphs. | ||
[Mermaid-JS](https://mermaid-js.github.io/mermaid/) takes this philosophy and applies it to graphs! Taking simple human-readable syntax and returning rich graphs. | ||
|
||
Github markdown does not automatically render mermaid to the browser, so this action does that for you so you can just worry about the markdown and not the toolchain. | ||
|
||
## Contributing | ||
|
||
Looking for suggestions/help in improving this action. If there is a feature you want, or you encounter a bug, please let me know and we can work together to improve it. | ||
Looking for suggestions/help in improving this action. If there is a feature you want, or you encounter a bug, please let me know and we can work together to improve it. | ||
|
||
## How to use | ||
|
||
|
@@ -32,53 +32,52 @@ on: | |
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
- name: get changed files | ||
id: getfile | ||
run: | | ||
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -e '.*\.md$' -e '.*\.mmd$' -e '.*\.mermaid$' | xargs)" | ||
- name: mermaid files changed | ||
run: | | ||
echo ${{ steps.getfile.outputs.files }} | ||
- name: compile mermaid | ||
uses: neenjaw/compile-mermaid-markdown-action@0.2.3 | ||
with: | ||
files: ${{ steps.getfile.outputs.files }} | ||
output: 'output' | ||
env: | ||
HIDE_CODEBLOCKS: 1 | ||
ABSOLUTE_IMAGE_LINKS: 1 | ||
|
||
- name: show changes | ||
run: | | ||
git status | ||
- name: Create Pull Request | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Add compiled mermaid | ||
title: '[MMDC] New mermaid files compiled' | ||
body: | | ||
- Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
labels: report, automated pr | ||
assignees: ${{ github.actor }} | ||
reviewers: ${{ github.actor }} | ||
- name: Check outputs | ||
run: | | ||
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}" | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}" | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
- name: get changed files | ||
id: getfile | ||
run: | | ||
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -e '.*\.md$' -e '.*\.mmd$' -e '.*\.mermaid$' | xargs)" | ||
- name: mermaid files changed | ||
run: | | ||
echo ${{ steps.getfile.outputs.files }} | ||
- name: compile mermaid | ||
uses: neenjaw/compile-mermaid-markdown-action@0.3.0 | ||
with: | ||
files: ${{ steps.getfile.outputs.files }} | ||
output: 'output' | ||
env: | ||
HIDE_CODEBLOCKS: 1 | ||
ABSOLUTE_IMAGE_LINKS: 1 | ||
|
||
- name: show changes | ||
run: | | ||
git status | ||
- name: Create Pull Request | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Add compiled mermaid | ||
title: '[MMDC] New mermaid files compiled' | ||
body: | | ||
- Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
labels: report, automated pr | ||
assignees: ${{ github.actor }} | ||
reviewers: ${{ github.actor }} | ||
- name: Check outputs | ||
run: | | ||
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}" | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}" | ||
``` | ||
### Sample workflow with changes pushed | ||
|
@@ -93,44 +92,43 @@ on: | |
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: get changed files | ||
id: getfile | ||
run: | | ||
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -e '.*\.md$' | xargs)" | ||
- name: md files changed | ||
run: | | ||
echo ${{ steps.getfile.outputs.files }} | ||
- name: compile mermaid | ||
uses: neenjaw/compile-mermaid-markdown-action@0.2.3 | ||
with: | ||
files: ${{ steps.getfile.outputs.files }} | ||
output: '.resources' | ||
env: | ||
HIDE_CODEBLOCKS: 1 | ||
ABSOLUTE_IMAGE_LINKS: 1 | ||
|
||
- name: show changes | ||
run: | | ||
git status | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "Add changes" -a | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: get changed files | ||
id: getfile | ||
run: | | ||
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -e '.*\.md$' | xargs)" | ||
- name: md files changed | ||
run: | | ||
echo ${{ steps.getfile.outputs.files }} | ||
- name: compile mermaid | ||
uses: neenjaw/compile-mermaid-markdown-action@0.3.0 | ||
with: | ||
files: ${{ steps.getfile.outputs.files }} | ||
output: '.resources' | ||
env: | ||
HIDE_CODEBLOCKS: 1 | ||
ABSOLUTE_IMAGE_LINKS: 1 | ||
|
||
- name: show changes | ||
run: | | ||
git status | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "Add changes" -a | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
``` |
Oops, something went wrong.