Giter VIP home page Giter VIP logo

wiki-page-creator-action's Introduction

Wiki Page Creator GitHub Action

This repository provides a GitHub action to publish Wiki pages with a provided markdown into the Wiki section of your GitHub repository.

Table of Contents

Common usage

The action requires some content markdown/wiki pages that must be generated on a previous step, and located into a specific folder.
This action scans the folder, adds its files, and finally publishes them to the wiki.

Breaking change

Starting from August 2019, GitHub team switch Actions syntax from HCL to YAML.
The previous syntax will no longer be supported by GitHub on September 30, 2019.

As a consequence, please use v2.0.0+ release and note that all v1.x.x are deprecated and will no longer work on September 30, 2019.

Use Github action

Please note that this action requires your repo to already own at least one page in the wiki section: https://github.com/:yourOrganization/:yourRepository/wiki

Settings for v1.0.0+ release (deprecated)

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

action "wiki-page-creator-action" {
  uses = "docker://decathlon/wiki-page-creator-action:1.0.0"
  needs = ["Create Release Notes"]
  secrets = [
    "GH_PAT",
  ]
  env = {
    ACTION_MAIL = "[email protected]"
    ACTION_NAME = "myusername"
    OWNER = "yourGitHubOrganisation"
    REPO_NAME = "yourGitHubRepository"
  }
}

Settings for v2.0.0+ release

- name: Upload Release Notes to Wiki
  uses: docker://decathlon/wiki-page-creator-action:2.0.0
  env:
    GH_PAT: ${{ secrets.GH_PAT }}
    ACTION_MAIL: [email protected]
    ACTION_NAME: yourusername
    OWNER: yourGitHubOrganisation
    REPO_NAME: yourGitHubRepository

Environment Variables options

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. You can click here to generate this token.

  • ACTION_MAIL: (required) email used to push new wiki pages into the target repository

  • ACTION_NAME: (required) username to use in the push command

  • OWNER: (required) repository owner name.

  • REPO_NAME: (required) repository name where you want to upload the wiki page to.

  • 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.

Full Example (with additional actions to generate content)

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

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 creates the markdown file (check here if your need more information). The output file is stored into the temp_release_notes.

The wiki-page-creator-action takes all the markdown files from the temp_release_notes folder (skipping a README.md file if found) and uploads them to the provided wiki repo.

Using v1.0.0+

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 = "docker://decathlon/release-notes-generator-action:1.0.0"
  secrets = ["GITHUB_TOKEN"]
  needs = ["action-filter"]
  env = {
    USE_MILESTONE_TITLE = "true"
    OUTPUT_FOLDER = "temp_release_notes"
  }
}

action "Upload Release Notes on Wiki" {
  uses = "docker://decathlon/wiki-page-creator-action:1.0.0"
  needs = ["Create Release Notes"]
  secrets = [
    "GH_PAT",
  ]
  env = {
    ACTION_MAIL = "[email protected]"
    ACTION_NAME = "myPushingUser"
    OWNER = "yourGitHubOrganisation"
    REPO_NAME = "yourGitHubRepository"
    SKIP_MD = "README.md"
    MD_FOLDER = "temp_release_notes"
  }
}

Using v2.0.0+

on: 
  milestone:
    types: [closed]
name: Milestone Closure
jobs:
  release-notes:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Create Release Notes
      uses: docker://decathlon/release-notes-generator-action:2.0.0
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        OUTPUT_FOLDER: temp_release_notes
        USE_MILESTONE_TITLE: "true"
    - name: Upload Release Notes to Wiki
      uses: docker://decathlon/wiki-page-creator-action:latest
      env:
        ACTION_MAIL: [email protected]
        ACTION_NAME: myPushingUser
        GH_PAT: ${{ secrets.GH_PAT }}
        MD_FOLDER: temp_release_notes
        OWNER: yourGitHubOrganisation
        REPO_NAME: yourGitHubRepository
        SKIP_MD: README.md

Credits

The code of this actions began on mmornati github workspace.

wiki-page-creator-action's People

Contributors

mmornati avatar lusoalex avatar lauthieb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.