Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow: Check if README.md and docs/README.md are in sync #2755

Merged

Conversation

kuanyi-ng
Copy link
Contributor

📑 Summary

This PR adds a GitHub workflow that checks if README.md and docs/README.md have the same content.

This is part of issue #2456. (Documentation section)

📏 Design Decisions

About workflow's triggers

In the contribution guide, it said that documentation-related changes can be committed directly to the develop branch.
So I made this workflow to target push and pull_request events for both master and develop branches.

Possible improvements (for another PR)

  1. Output which README.md is newer so it's easier to sync both README.md files.
    a. still don't have a concrete idea on how to determine if one README.md is newer than the other
    a. this information might be available from git log or git blame
  2. Sync the content of README.md and docs/README.md as a part of the workflow.
    a. it might be possible to automatically apply the changes to either one of the READMEs.
  3. Also check if CHANGELOG.md and docs/CHANGELOG.md have the same content.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted develop branch

@kuanyi-ng kuanyi-ng changed the title Add workflow: Check if README.md and docs/README.md are in sync Workflow: Check if README.md and docs/README.md are in sync Feb 19, 2022
Copy link
Collaborator

@ashishjain0512 ashishjain0512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you that's super userful!

@ashishjain0512 ashishjain0512 merged commit 26f9924 into mermaid-js:develop Feb 24, 2022
@mmorel-35
Copy link
Contributor

Why merging this if the new workflow doesn't pass?
Now every PR on the master is going to fail

@kuanyi-ng
Copy link
Contributor Author

Why merging this if the new workflow doesn't pass? Now every PR on the master is going to fail

@mmorel-35
Sorry for not making sure the workflow will pass before this PR is merged.
Following are a few solutions to this situation:

  1. Revert this PR → Sync README.md and re-adding this workflow in one PR
  2. Sync README.md in another PR (without reverting this PR)

Assuming that syncing both README.md will take up some time, I think reverting this PR is better for the moment.
What do you think?

@mmorel-35
Copy link
Contributor

I prefer the second option, this feature is great. The synchronisation just need to be fixed

@kuanyi-ng
Copy link
Contributor Author

kuanyi-ng commented Mar 1, 2022

I'm afraid I don't know much about mermaid.js to proceed with the second option. (Just found out about mermaid.js last week). Are there any guidelines that I can follow while syncing both README.md?

@Yash-Singh1
Copy link
Member

There will be some road bumps when doing this:

  1. Ensure if we need the CI checks in the documentation header.
  2. Make sure the images for the Mermaid.js diagrams should appear in the README and documentation (README should use different code fence names than documentation)
  3. Sync links between README and docs without having any resolving problems as they exist in different in different directories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants