|
| 1 | +# Github Wiki Publish Action |
| 2 | + |
| 3 | +This [GitHub Action][github actions] |
| 4 | +publishes the contents of a directory to your project's [wiki][github wiki] |
| 5 | +from a workflow. |
| 6 | + |
| 7 | +## Setup |
| 8 | + |
| 9 | +This GitHub action requires that your repository has the following: |
| 10 | + |
| 11 | +- A wiki with at least one page in it |
| 12 | +- A secret named `GITHUB_PERSONAL_ACCESS_TOKEN` |
| 13 | + with a Github personal access token with "repo" authorization |
| 14 | + |
| 15 | +Follow the steps below to ensure that everything's configured correctly. |
| 16 | + |
| 17 | +> **Note** |
| 18 | +> GitHub doesn't currently provide APIs for interacting with project wikis, |
| 19 | +> so much of the required setup must be done manually. |
| 20 | +
|
| 21 | +### 1. Enable Your Repository's Wikis Feature |
| 22 | + |
| 23 | +Navigate to the "Settings" tab for your repository, |
| 24 | +scroll down to the "Features" section, |
| 25 | +and ensure that the checkbox labeled "Wikis" is checked. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +### 2. Create the First Wiki Page |
| 30 | + |
| 31 | +With the Wikis feature enabled for your repository, |
| 32 | +navigate to the "Wiki" tab. |
| 33 | +If prompted, |
| 34 | +create the first wiki page. |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +### 3. Generate a Personal Access Token |
| 39 | + |
| 40 | +Navigate to the [Personal access tokens](https://github.com/settings/tokens) page |
| 41 | +in your GitHub account settings |
| 42 | +(Settings > Developer settings > Personal access tokens) |
| 43 | +and click the "Generate a new token" button. |
| 44 | + |
| 45 | +In the "New personal access token" form, |
| 46 | +provide a descriptive comment in the "Note" field, like "Wiki Management". |
| 47 | +Under "Select scopes", |
| 48 | +enable all of the entries under "repo" perms. |
| 49 | + |
| 50 | +When you're done, |
| 51 | +click the "Generate token" button at the bottom of the form. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +> **Note**: |
| 56 | +> GitHub actions have access to [a `GITHUB_TOKEN` secret][GITHUB_TOKEN], |
| 57 | +> but that token's permissions are limited to |
| 58 | +> the repository that contains your workflow. |
| 59 | +> This workflow requires the generation of a new personal acccess token |
| 60 | +> to read and write to the git repository for your project's wiki. |
| 61 | +
|
| 62 | +### 4. Set a Repository Secret |
| 63 | + |
| 64 | +Copy your generated personal access token to the clipboard |
| 65 | +and navigate to your project settings. |
| 66 | +Navigate to the "Secrets" page, |
| 67 | +click "Add a new secret", |
| 68 | +and fill in the form by |
| 69 | +entering `GITHUB_PERSONAL_ACCESS_TOKEN` into the "Name" field and |
| 70 | +pasting your token into the "Value" field. |
| 71 | + |
| 72 | +## License |
| 73 | + |
| 74 | +MIT |
| 75 | + |
| 76 | +## Contact |
| 77 | + |
| 78 | +Mattt ([@mattt](https://twitter.com/mattt)) |
| 79 | + |
| 80 | +[github actions]: https://help.github.com/en/actions |
| 81 | +[github wiki]: https://help.github.com/en/github/building-a-strong-community/about-wikis |
| 82 | +[GITHUB_TOKEN]: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret |
0 commit comments