Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
book-open

GitHub Action

wiki-page-creator-action

v1.0.0

wiki-page-creator-action

book-open

wiki-page-creator-action

Action to create a GitHub wiki page based on provided Markdown file

Installation

Copy and paste the following snippet into your .yml file.

              

- name: wiki-page-creator-action

uses: Decathlon/[email protected]

Learn more about this action in Decathlon/wiki-page-creator-action

Choose a version

wiki-page-creator-action

The target of this action is to publish Wiki pages using the provided markdown: into the repository, commits or as the result of a previous action.

Getting Started

To use this action simply add it to your main.workflow file.

action "wiki-page-creator-action" {
  uses = "decathlon/wiki-page-creator-action@master"
  needs = ["Create Release Notes"]
  secrets = [
    "GH_PAT",
  ]
  env = {
    ACTION_MAIL = "[email protected]"
    ACTION_NAME = "myusername"
    WIKI_REPO_URL = "myuser/myrepo.wiki.git"
  }
}

To be able to push the new Wiki Page, the action requires some environment variables/secrets:

  • GH_PAT: (required) GitHub Private Access Token used for the clone/push operations. The token is used for security reasons, instead of the username/password, and because is the only way to access to repositories for organizations using SSO. To create it follow the GitHub Documentation.
  • ACTION_MAIL: (required) email used to push new wiki pages into the target repository
  • ACTION_NAME: (required) username to use in the push command
  • WIKI_REPO_URL: (required) wiki repo url. It should be only the username/reponame part of the url. On the GitHub Wiki page you will have the complete repository url https://help.github.com/en/articles/adding-or-editing-wiki-pages#adding-or-editing-wiki-pages-locally
  • MD_FOLDER: (optional - default is the current folder) folder to scan for markdown files
  • SKIP_MD: (optional - all files will be processed) comma separated list of files to skip during the analysis (files you don't want to publish)
  • WIKI_PUSH_MESSAGE: (optional - sample message will use instead) Custom push message for your wiki pages.

Example

The following one is the workflow we are using to push the release notes to our project wikis.

workflow "Sprint Closure" {
  on = "milestone"
  resolves = ["Upload Release Notes on Wiki"]
}

action "action-filter" {
  uses = "actions/bin/filter@master"
  args = "action closed"
}

action "Create Release Notes" {
  uses = "Decathlon/release-notes-generator-action@master"
  secrets = ["GITHUB_TOKEN"]
  needs = ["action-filter"]
  env = {
    USE_MILESTONE_TITLE = "true"
    OUTPUT_FOLDER = "temp_release_notes"
  }
}

action "Upload Release Notes on Wiki" {
  uses = "Decathlon/wiki-page-creator-action@master"
  needs = ["Create Release Notes"]
  secrets = [
    "GH_PAT",
  ]
  env = {
    ACTION_MAIL = "[email protected]"
    ACTION_NAME = "myPushingUser"
    WIKI_REPO_URL = "Decathlon/my-sample-repo.wiki.git"
    SKIP_MD = "README.md"
    MD_FOLDER = "temp_release_notes"
  }
}

In this example the workflow is started on milestone; the first action is filtering on the closed action of the milestone (if milestone is created, renamed, ... the other steps are skipped).

The create-release-notes-action is taking care to the markdown file creation (check here if your need more information). The output file is stored into the temp_release_notes.

Then the wiki-page-creator-action is taking all the MD files into the temp_release_notes folder (skipping a README.md file if found) and is uploading them to the provided wiki repo.

Credits

The code of this actions began on mmornati github workspace.