{"id":16420740,"url":"https://github.com/andrew-chen-wang/github-wiki-action","last_synced_at":"2026-03-08T20:04:27.553Z","repository":{"id":41832067,"uuid":"272779659","full_name":"Andrew-Chen-Wang/github-wiki-action","owner":"Andrew-Chen-Wang","description":"📖 GitHub Action to sync a folder to the GitHub wiki","archived":false,"fork":false,"pushed_at":"2023-07-17T01:15:19.000Z","size":121,"stargazers_count":67,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-22T03:43:37.764Z","etag":null,"topics":["actions","bash","github-action","github-actions","github-wiki","wiki"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Andrew-Chen-Wang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-16T18:10:45.000Z","updated_at":"2024-10-21T15:24:28.000Z","dependencies_parsed_at":"2024-06-18T18:35:55.110Z","dependency_job_id":"4084097c-60cc-4aae-9105-33d5d2eeb1c7","html_url":"https://github.com/Andrew-Chen-Wang/github-wiki-action","commit_stats":{"total_commits":37,"total_committers":3,"mean_commits":"12.333333333333334","dds":0.4054054054054054,"last_synced_commit":"7f44b142379b209235c748351558937d3e7546a7"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrew-Chen-Wang%2Fgithub-wiki-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrew-Chen-Wang%2Fgithub-wiki-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrew-Chen-Wang%2Fgithub-wiki-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrew-Chen-Wang%2Fgithub-wiki-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Andrew-Chen-Wang","download_url":"https://codeload.github.com/Andrew-Chen-Wang/github-wiki-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822295,"owners_count":20353500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","bash","github-action","github-actions","github-wiki","wiki"],"created_at":"2024-10-11T07:29:01.038Z","updated_at":"2026-03-08T20:04:27.547Z","avatar_url":"https://github.com/Andrew-Chen-Wang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nCopyright 2023 Andrew Chen Wang\nCopyright 2023 Jacob Hummer\nSPDX-License-Identifier: Apache-2.0\n--\u003e\n\n# Publish to GitHub wiki\n\n📖 GitHub Action to sync a folder to the GitHub wiki\n\n\u003cdiv align=\"center\"\u003e\n\n![](https://user-images.githubusercontent.com/61068799/231881220-2915f956-dbdb-4eee-8807-4eba9537523f.png)\n\n\u003c/div\u003e\n\n📂 Keep your dev docs in sync with your code \\\n💡 Inspired by [Decathlon/wiki-page-creator-action#11] \\\n🔁 Able to open PRs with docs updates \\\n✨ Use the fancy GitHub wiki reader UI for docs \\\n🌐 Works across repositories (with a [PAT]) \\\n💻 Supports `runs-on: windows-*`\n\n## Usage\n\n![GitHub Actions](https://img.shields.io/static/v1?style=for-the-badge\u0026message=GitHub+Actions\u0026color=2088FF\u0026logo=GitHub+Actions\u0026logoColor=FFFFFF\u0026label=)\n![GitHub](https://img.shields.io/static/v1?style=for-the-badge\u0026message=GitHub\u0026color=181717\u0026logo=GitHub\u0026logoColor=FFFFFF\u0026label=)\n\nAdd a GitHub Actions workflow file to your `.github/workflows/` folder similar\nto the example shown below.\n\n```yml\nname: Publish wiki\non:\n  push:\n    branches: [main]\n    paths:\n      - wiki/**\n      - .github/workflows/publish-wiki.yml\nconcurrency:\n  group: publish-wiki\n  cancel-in-progress: true\npermissions:\n  contents: write\njobs:\n  publish-wiki:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: Andrew-Chen-Wang/github-wiki-action@v4\n```\n\n☝ This workflow will mirror the `wiki/` folder in your GitHub repository to the\n`user/repo.wiki.git` Git repo that houses the wiki documentation! You can use\nany of the [supported markup languages] like MediaWiki, Markdown, or AsciiDoc.\n\n🔑 In order to successfully push to the `.wiki.git` Git repository that backs\nthe wiki tab, we need the `contents: write` permission! Make sure you have\nsomething like shown above either for your entire workflow, or just for one\nparticular job. This will give the auto-generated `${{ github.token }}` that we\nuse by default permission to push to the `.wiki.git` repo of the repository that\nthe action runs on.\n\n\u003cimg align=\"right\" alt=\"Screenshot of 'Create the first page' button\" src=\"https://i.imgur.com/ABKIS4h.png\" /\u003e\n\n⚠️ You must create a dummy page manually! This is what initially creates the\nGitHub wiki Git-based storage backend that we then push to in this Action.\n\nAfter creating your workflow file, now all you need is to put your Markdown\nfiles in a `wiki/` folder (or whatever you set the `path` option to) and commit\nthem to your default branch to trigger the workflow (or whatever other trigger\nyou set up).\n\n💡 Each page has an auto-generated title. It is derived from the filename by\nreplacing every `-` (dash) character with a space. Name your files accordingly.\nThe `Home.md` file will automatically become the homepage, not `README.md`. This\nis specific to GitHub wikis.\n\n### Inputs\n\n- **`strategy`:** Select from `clone` or `init` to determine which method to use\n  to push changes to the GitHub wiki. `clone` will clone the `.wiki.git` repo\n  and add an additional commit. `init` will create a new repo with a single\n  commit and force push to the `.wiki.git`. `init` involves a force-push! The\n  default is `clone`.\n\n- **`repository`:** The repository housing the wiki. Use this if you're\n  publishing to a wiki that's not the current repository. You can change the\n  GitHub server with the `github-server-url` input. Default is\n  `${{ github.repository }}`.\n\n- **`github-server-url`:** An alternate `https://github.com` URL, usually for\n  GitHub Enterprise deployments under your own domain. Default is\n  `${{ github.server_url }}` (usually `https://github.com`).\n\n- **`token`:** `${{ github.token }}` is the default. This token is used when\n  cloning and pushing wiki changes.\n\n- **`path`:** The directory to use for your wiki contents. Default `wiki/`.\n\n- **`commit-message`:** The message to use when committing new content. Default\n  is `Update wiki ${{ github.sha }}`. You probably don't need to change this,\n  since this only applies if you look really closely in your wiki.\n\n- **`ignore`:** A multiline list of files that should be ignored when committing\n  and pushing to the remote wiki. Each line is a pattern like `.gitignore`. Make\n  sure these paths are relative to the path option! The default is none.\n\n- **`dry-run`:** Whether or not to actually attempt to push changes back to the\n  wiki itself. If this is set to `true`, we instead print the remote URL and do\n  not push to the remote wiki. The default is `false`. This is useful for\n  testing.\n\n- **`preprocess`:** If this option is true, we will preprocess the wiki to move\n  the `README.md` to `Home.md` as well as rewriting all `.md` links to be bare\n  links. This helps ensure that the Markdown works in source control as well as\n  the wiki. The default is true.\n\n- **`disable-empty-commits`:** By default, any triggering of this action will\n  result in a commit to the Wiki, even if that commit is empty.\n  If this option is true, a workflow run which would result in no changes\n  to the Wiki files, will no longer create an empty commit. The default is false.\n\n#### `strategy:` input\n\nThere are some specific usecases where using `strategy: init` might be better\nthan the default `strategy: clone`.\n\n1. **Your wiki is enormous.** And I don't mean in terms of text. Text is nothing\n   compared with images. If your wiki has a lot of included images, then you\n   probably don't want to store the complete history of those large binary\n   files. Instead, you can use `strategy: init` to create a single commit each\n   time.\n\n2. **You prefer the \"deploy\" semantics.** If you just like the feel of having\n   your GitHub wiki act more like GitHub Pages, that's great! You can `--force`\n   push using `strategy: init` on each wiki deployment and none of that pesky\n   history will be saved.\n\n### Outputs\n\n- **`wiki_url`:** The HTTP URL that points to the deployed repository's wiki\n  tab. This is essentially the concatenation of `${{ github.server_url }}`,\n  `${{ github.repository }}`, and the `/wiki` page.\n\n### Cross-repo wikis\n\nYou _can_ use this action to deploy your octocat/mega-docs repository to the\noctocat/mega-project repository's wiki tab! You just need to:\n\n1. Create a custom GitHub Personal Access Token with the permissions to push to\n   the octocat/mega-project repository. That's the target repo where your wiki\n   pages will be pushed to the `.wiki.git`.\n2. In the octocat/mega-docs repo (the source code for the wiki), you need to set\n   the `repository:` option to `repository: octocat/mega-project` to tell the\n   action to push there.\n3. You need to set the `token:` option to the Personal Access Token that you\n   created with the ability to push to the wiki Git repo. You can use repository\n   secrets for this! Something like `token: ${{ secrets.MY_TOKEN }}` is good!\n\nHere's an example of the octocat/mega-docs repo that will push the contents of\nthe root folder (`./`) to the octocat/mega-project repo's wiki tab!\n\n```yml\non:\n  push:\n    branches: [main]\njobs:\n  publish-wiki:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: Andrew-Chen-Wang/github-wiki-action@v4\n        with:\n          token: ${{ secrets.MEGA_PROJECT_GITHUB_TOKEN }}\n          repository: octocat/mega-project\n          path: .\n```\n\n## Development\n\n![Deno](https://img.shields.io/static/v1?style=for-the-badge\u0026message=Deno\u0026color=000000\u0026logo=Deno\u0026logoColor=FFFFFF\u0026label=)\n![GitHub Actions](https://img.shields.io/static/v1?style=for-the-badge\u0026message=GitHub+Actions\u0026color=2088FF\u0026logo=GitHub+Actions\u0026logoColor=FFFFFF\u0026label=)\n\nThis GitHub Action uses a self-downloaded version of Deno. See `cliw` for the\n`cli.ts` wrapper script that downloads the Deno binary and runs the TypeScript\ncode. The main script itself is ~100 lines of code, so it's not too bad.\n\nℹ Because the version of Deno is _pinned_, it's recommended to every-so-often\nbump it to the latest version.\n\nTo test the action, open a PR! The `test-action.yml` workflow will run the code\nwith `dry-run: true` as well as a real run! Yes, this does get tedious swapping\nbetween your IDE and the PR, but it's the easiest way to test the action.\n\n\u003c!-- prettier-ignore-start --\u003e\n[Decathlon/wiki-page-creator-action#11]: https://github.com/Decathlon/wiki-page-creator-action/issues/11\n[supported markup languages]: https://github.com/github/markup#markups\n[PAT]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\n\u003c!-- prettier-ignore-end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrew-chen-wang%2Fgithub-wiki-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrew-chen-wang%2Fgithub-wiki-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrew-chen-wang%2Fgithub-wiki-action/lists"}