generated from google/new-project
-
Notifications
You must be signed in to change notification settings - Fork 4
Add documentation and publish it to GitHub Pages. #18
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2522083
Initial commit to convert markdown to GitHub pages.
billnapier 076e12c
Make sure publish-pages action is reading our generated content.
billnapier dfa49cc
Put the path arg on the right action.
billnapier 379643e
only deploy on main
billnapier e5c7449
Hook in PR preview so we can see the pages before merge.
billnapier 8c61d45
Fix "if" tests to get the right behavior.
billnapier fb156a7
Break doc publishing up so they trigger on the right things.
billnapier 7beb95c
Add missing workflow
billnapier abe0ed1
Update permissions so workflow can publish.
billnapier 9a3690c
Should also need pull-request write so it can comment on the PR.
billnapier 91433f2
Checkpoint to see if this is working.
billnapier 70f1c5a
Add page artifact uploading.
billnapier 35b2b08
Add initial set of rule documentation, mdformat everything and add a …
billnapier c2cc53e
add index.md
billnapier 7c1decc
Update docs.
billnapier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ### Ensure that markdown files are properly formatted | ||
| name: 'Check Markdown Format' | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| mdformat: | ||
| name: 'mdformat' | ||
| runs-on: 'ubuntu-latest' | ||
|
|
||
| steps: | ||
| - name: 'Checkout Code' | ||
| uses: 'actions/checkout@v4' | ||
|
|
||
| - name: 'Check Markdown Format' | ||
| run: 'pipx run mdformat --check --wrap 100 .' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: 'Publish Docs Site' | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| pages: 'write' | ||
| id-token: 'write' | ||
|
|
||
| jobs: | ||
| build: | ||
| name: "Build Docs" | ||
| runs-on: 'ubuntu-latest' | ||
| steps: | ||
| - uses: 'actions/checkout@v4' | ||
| - name: 'Generate HTML from Markdown' | ||
| uses: 'ldeluigi/markdown-docs@latest' | ||
| with: | ||
| src: 'docs' | ||
| dst: 'generated-pages' | ||
| - name: 'Upload artifact' | ||
| uses: 'actions/upload-pages-artifact@v3' | ||
| with: | ||
| path: 'generated-pages' | ||
| deploy: | ||
| name: "Deploy Docs" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a pain - mixed quotes, different from every other quote. Every yaml has the same issue. |
||
| environment: | ||
| name: 'github-pages' | ||
| url: '${{ steps.deployment.outputs.page_url }}' | ||
| runs-on: 'ubuntu-latest' | ||
| needs: 'build' | ||
| steps: | ||
| - name: 'Deploy to GitHub Pages' | ||
| id: 'deployment' | ||
| uses: 'actions/deploy-pages@v4' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: 'Publish Preview of Docs Site' | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - closed | ||
|
|
||
| permissions: | ||
| contents: 'write' | ||
| pull-requests: 'write' | ||
|
|
||
| jobs: | ||
| build: | ||
| name: "Build PR Preview Docs" | ||
| runs-on: 'ubuntu-latest' | ||
| steps: | ||
| - uses: 'actions/checkout@v4' | ||
| - name: 'Generate HTML from Markdown' | ||
| uses: 'ldeluigi/markdown-docs@latest' | ||
| with: | ||
| src: 'docs' | ||
| dst: 'generated-pages' | ||
| - name: 'Deploy GitHub Pages Preview' | ||
| uses: rossjrw/pr-preview-action@v1 | ||
| with: | ||
| source-dir: './generated-pages/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: 'Publish Preview of Docs Site from branch' | ||
|
|
||
| # The publish_docs_preview.yml workflow takes a PR and publishes the results to it's own branch | ||
| # so users can preview it. But that git branch then needs some way to publish, so this action does that. | ||
|
|
||
| on: | ||
| push: | ||
| branch: | ||
| - gh-pages | ||
|
|
||
| permissions: | ||
| pages: 'write' | ||
| id-token: 'write' | ||
|
|
||
|
|
||
| jobs: | ||
| stage: | ||
| name: "Stage PR preview from branch to pages" | ||
| runs-on: 'ubuntu-latest' | ||
| steps: | ||
| - uses: 'actions/checkout@v4' | ||
| with: | ||
| ref: 'refs/heads/gh-pages' | ||
| - name: 'Upload artifact' | ||
| uses: 'actions/upload-pages-artifact@v3' | ||
| with: | ||
| path: '.' | ||
| deploy: | ||
| name: "Deploy PR Preview from branch to pages" | ||
| needs: 'stage' | ||
| environment: | ||
| name: 'gh-pages-pr-preview' | ||
| url: '${{ steps.deployment.outputs.page_url }}' | ||
| runs-on: 'ubuntu-latest' | ||
| steps: | ||
| - name: 'Deploy to GitHub Pages' | ||
| id: 'deployment' | ||
| uses: 'actions/deploy-pages@v4' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| # The Home of GitHub Source Solutions | ||
|
|
||
| This is where the team that manages GitHub for Google places things (like required workflows) to use across the enterprise. | ||
| This is where the team that manages GitHub for Google places things (like required workflows) to use | ||
| across the enterprise. | ||
|
|
||
| We also own a number of other repositories. See them [here](https://github.com/topics/github-source-solutions) | ||
| We also own a number of other repositories. See them | ||
| [here](https://github.com/topics/github-source-solutions) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # GitHub Source Solutions | ||
|
|
||
| A collection of things we use to manage the Google Enterprise presence on GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # pull-request-target-needs-exception | ||
|
|
||
| If you can, prefer using `pull_request` or other triggers instead of `pull_request_target`. The | ||
| tl;dr here motivation is that workflows run from `pull_request_target` have (by default) read/write | ||
| acesss to the repository and access to the secrets, even when run from a fork. If the workflow then | ||
| checks out and runs the untrusted code from the PR, this is a problem. | ||
|
|
||
| GitHub has a really good writeup of the perils here: | ||
| https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/ | ||
|
|
||
| For now, this rule is just a warning. It will eventually require an exception to use once we get | ||
| that process working. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quotes - applies in multiple yaml files below too