Describe your question in as much detail as possible:
A copy of the repository is here: cdwijs / markdown-test · GitLab
I have a CI/CD job that generates a .png file. I can embed that .png file in the README.md file like this:
This works fine, but when the repository is forked, the readme.md still uses the diagrams from this repository, instead of the forked repositories, resulting is stale graphs that are no longer generated from the correct repository. Therefore I want to use relative links.
This does not result in a graph, just a link:
When I click he link, I see the link comes out like this:
When I put the working and the non-working link under each other, I see the non-working link has “main” extra in the middle:
https://git.lumc.nl/crldewijs/markdown-test/-/jobs/artifacts/main/raw/html/dot_inline_dotgraph_1.png?job=deploy (working) https://git.lumc.nl/crldewijs/markdown-test/main/jobs/artifacts/main/raw/html/dot_inline_dotgraph_1.png?job=deploy (not working)
What is the correct way to relative link to the image?
Add the CI configuration from
.gitlab-ci.ymland other configuration if relevant (e.g. docker-compose.yml)
See also cdwijs / markdown-test · GitLab
image: gcc variables: GIT_SUBMODULE_STRATEGY: recursive #https://docs.gitlab.com/ee/ci/git_submodules.html deploy: stage: deploy before_script: - apt update && apt -y install doxygen graphviz script: - doxygen artifacts: paths: - ./html/dot_inline_dotgraph_1.png # - ./html/index.html
What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?
I have found the way to link to a generated asset here: Job artifacts | GitLab
I have done some trial and error with the direct links here:
Link in readme.md to a single artifact (.png file) created by a CI/CD runner - #5 by cdwijs
Thanks for taking the time to be thorough in your request, it really helps!