Skip to content

Use PAT for publishing docs#171

Merged
Gudahtt merged 2 commits intomainfrom
update-doc-publishing-workflow
Apr 11, 2023
Merged

Use PAT for publishing docs#171
Gudahtt merged 2 commits intomainfrom
update-doc-publishing-workflow

Conversation

@Gudahtt
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt commented Feb 7, 2023

The publish-docs workflow has been updated to use a personal access token for publishing docs instead of using the GITHUB_TOKEN. This allows for more control over doc publishing permissions.

Fixes #184

Examples

This has been implemented in the utils library: MetaMask/utils#96

@Gudahtt
Copy link
Copy Markdown
Member Author

Gudahtt commented Feb 27, 2023

I was investigating whether we could publish using a custom GitHub actions workflow rather than use a branch, and rely upon the environment required reviewers setting instead of PR review.

But unfortunately that API doesn't seem well suited for publishing to a subdirectory. The only option is to overwrite the entire site. We could download the current site and merge changes into it, except that I can't see a way to download the current site either. So long as we're publishing to subdirectories, we're stuck with the gh-pages branch.

@Gudahtt Gudahtt force-pushed the update-doc-publishing-workflow branch from e854174 to 0b0b55f Compare February 27, 2023 22:34
@Gudahtt Gudahtt marked this pull request as ready for review February 27, 2023 22:35
@Gudahtt Gudahtt requested a review from a team as a code owner February 27, 2023 22:35
mcmire
mcmire previously approved these changes Feb 27, 2023
Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Okay, makes sense to me.

The `publish-docs` workflow has been updated to use a personal access
token for publishing docs instead of using the `GITHUB_TOKEN`. This
allows for more control over doc publishing permissions.
@Gudahtt Gudahtt force-pushed the update-doc-publishing-workflow branch from 0b0b55f to 62fb0b9 Compare March 29, 2023 14:31
@Gudahtt Gudahtt marked this pull request as draft March 29, 2023 14:38
@Gudahtt
Copy link
Copy Markdown
Member Author

Gudahtt commented Mar 29, 2023

I have just updated this PR to forward secrets to the publishing workflow, which wasn't being done before. I expect that this would have failed beforehand, because the secret would have been missing.

I haven't tested this with a fork yet, I'll do that before bringing this back out of draft again. I'll add an example as well, I noticed that step was missed too.

Update: I can't test this with a fork because the "bypass review" branch protection setting isn't available on forks. But I'll test it on the utils repo first at least.

@Gudahtt Gudahtt force-pushed the update-doc-publishing-workflow branch from 62fb0b9 to 359e92b Compare April 4, 2023 14:35
@Gudahtt Gudahtt marked this pull request as ready for review April 11, 2023 14:24
@Gudahtt
Copy link
Copy Markdown
Member Author

Gudahtt commented Apr 11, 2023

Marking this as ready for review because it has now been tested in the utils repo.

Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Nice!

@Gudahtt Gudahtt merged commit 54cef55 into main Apr 11, 2023
@Gudahtt Gudahtt deleted the update-doc-publishing-workflow branch April 11, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add branch protections for gh-pages branch

4 participants