Skip to content

Instantly share code, notes, and snippets.

@nilsreichardt
Last active April 2, 2023 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nilsreichardt/370f8ace0ae07c7c217c8cf794400830 to your computer and use it in GitHub Desktop.
Save nilsreichardt/370f8ace0ae07c7c217c8cf794400830 to your computer and use it in GitHub Desktop.
A prompt to convert text into a Mermaid control flow graph

Prompt

Please convert the following text into a Mermaid diagram like a control flow graph. The "Jump to" commands should not be translated 1:1. Instead, you should use the connections arrows (-->). Do not name the numbers in the diagram. Convert double quotes to single quotes. Decisions are using {} instead of []. Use meaningful graph IDs instead of (1,2,3 or A, B, C).

  1. Is PR a fork? If yes, jump to 2, if no, jump to 3
  2. Remove the "safe to build" label, jump to 3
  3. Execute the "changes" workflow, jump to 4
  4. Is PR a fork? If yes, jump to 5, if no, jump to 7
  5. Has PR "safe to build label"? If yes, jump to 7, if no, jump to 6.
  6. Cancel
  7. Execute the workflows

ChatGPT

image

Result

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment