I use the GitHub pages feature whereby it creates a GitHub Pages site by using the README.md file in your repository. This works well, except for one problem. In my README.md file, I have code blocks illustrating the use of GitHub Actions workflows, and inside the code blocks, references to GitHub Actions variables of the form ${{github.foo.bar}}. This is rendered fine on the repository page in GitHub, but in the corresponding GitHub Pages site, the variables disappear! Here is an actual example from one of my repos. First the relevant portion of the README.md as appears in the GitHub repository view:
Now the corresponding portion of the GitHub Pages result:
How can I prevent this from happening?
I thought about quoting the $ characters using \, but the backslashes appear in the README.md view, and thus may lead people to copy incorrect GitHub Actions code.


I believe Jekyll (the static site generator used by GitHub Pages) is seeing
{{stuff}}and trying to expand it (because it uses{{…}}to inline variables). You can prevent Jekyll from doing this by using{% raw %}{{…}}{% endraw %}in your Markdown file, but then that text will show up as-is on the GitHub repository home page (which showsREADME.mdas HTMLified Markdown without running it through Jekyll expression expansion). I don't know of a way to have just{{…}}show up in the GitHub repo home page and in the rendered GitHub Pages site :-(