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

Wrong READMEs in github packages #783

Closed
prasadtalasila opened this issue May 20, 2024 · 7 comments · Fixed by #958
Closed

Wrong READMEs in github packages #783

prasadtalasila opened this issue May 20, 2024 · 7 comments · Fixed by #958
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@prasadtalasila
Copy link
Contributor

GitHub Packages uses the README from the root of the repository for all packages in the repository. If you want to have a specific README for a package in a monorepo, you can use a workaround.

The workaround is to temporarily move to the package directory, copy the package-specific README to the root, publish the package, and then move the README back. Here's how you can do it:

# Move to the package directory
cd package

# Copy the package README to the root
cp README.md ../

# Publish the package
npm publish

# Restore the root README back
mv README.md packages/my-package/

This will ensure that the package-specific README is used when publishing the package to GitHub Packages. Remember to replace packages/my-package with the actual path to your package directory.

courtesy: Github co-pilot

@prasadtalasila prasadtalasila added the bug Something isn't working label May 20, 2024
@prasadtalasila
Copy link
Contributor Author

This change is to be made in:

  • github actions
  • documentation

@prasadtalasila
Copy link
Contributor Author

The pending problems to fix:

  • Remove image links from README of servers/lib. Put all the images in the documentation.
  • Correct READMEs for dtaas-web and libms docker images. A dedicated README is needed for each of the docker images. The filenames could be docker/WEB.md and docker/LIBMS.md. These files need to overwrite the top-level README in docker.yml workflow. It could be done on line-39 of docker.yml. The name of the file must come as parameter to the yaml (similar in technique to inputs.dockerfile.

@prasadtalasila prasadtalasila added this to the Release v0.6.0 milestone Jun 19, 2024
@prasadtalasila
Copy link
Contributor Author

Also remember to remove the docker-specific information from READMEs of libms and client packages. The idea is to have separate READMEs for docker and npm packages. These READMEs should only contain information for the matching github package.

@aryanpingle
Copy link
Contributor

Based on this issue posted in docker/build-push-action and this ongoing GitHub community thread, it looks like the README file shown alongside a GitHub package for a docker image is that of the repository's, and cannot be set to a custom markdown file. This is not the case for GitHub packages deployed to NPM, which is why the runner and libms packages display the correct markdown file that we specify.

@aryanpingle
Copy link
Contributor

The best practice we could follow is to add links in the DTaaS repository README, something like:

Introduction
 |--- Intro to the repository
 |--- Intro to the Docker Image

@prasadtalasila
Copy link
Contributor Author

@aryanpingle Does the path context option help in anyway?

@aryanpingle
Copy link
Contributor

From my testing, the git and path options help in setting the "context" of the docker container, i.e. letting you access different repositories and their workflows. This doesn't seem to solve the problem of the README file displayed on GitHub.

There is a config option called org.opencontainers.image.source which links a package to any repository of your choice. GitHub currently uses predefined OCI annotations to determine the README file displayed, so this might be the solution we're looking for. I'll try it out and post the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants