Skip to content
book

GitHub Action

Update wiki with PHP project documentation

v1.0.0 Latest version
Use latest version
book

Update wiki with PHP project documentation

Updates project wiki with automatic generated PHP project documentation

Installation

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

- name: Update wiki with PHP project documentation
  uses: impresscms-dev/phpdocs-wiki-update-action@v1.0.0
Learn more about this action in impresscms-dev/phpdocs-wiki-update-action
Choose a version

Update wiki with PHP project documentation action

License GitHub release Maintainability

Updates GitHub project wiki with automatic generated project documentation.

Works only if project has definitions in composer.json.

Usage

Before starting to use this action make sure:

  • Wiki is enabled in project settings
  • at least one page in project Wiki exist

To use this action in your project, create workflow in your project similar to this code (Note: some parts and arguments needs to be altered):

name: Automatic update project documentation

on:
  push:
    branches:
      - master
    tags:
      - 'v*'

jobs:
  update_wiki:
    runs-on: ubuntu-latest
    steps:
      - name: Checkouting project code...
        uses: actions/checkout@v2
      - name: Updating wiki...
        uses: impresscms-dev/phpdocs-wiki-update-action
        with:
          wiki_github_update_token: ${{ secrets.WIKI_GITHUB_UPDATE_TOKEN }}
          wiki_github_update_user: ${{ secrets.WIKI_GITHUB_UPDATE_USER }}
          engine: clean/phpdoc-md
          class_root_namespace: My Project
          include: |
            MyProject\**

Arguments

This action supports such arguments (used in with keyword):

Argument Required Default value Description
wiki_github_update_token Yes GitHub token to use for updating project wiki. This token must have all repo permissions.
wiki_github_update_user Yes GitHub username for whom this token belongs
engine No clean/phpdoc-md What documentation generator should be used? See engines section about possible values
prefix_lines No ##### Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually! Lines that will be used to prefix generated wiki content

Some engines supports or requires extra parameters. See engines section about more info.

Engines

Update wiki with PHP project documentation action supports multiple engines for generating content. Usually names for engines are same as composer packages that they are using. Different engines can provide different results (f.e. output; some engines can crash with same parameters when others can work).

clean/phpdoc-md 🔗

This engine is default for the action. It needs to specify classes that should be included in generated wiki code, but it works much faster than evert/phpdoc-md. Sadly, not for every project right now is possible to use this one.

This engine supports such extra arguments:

Argument Required Default value Description
class_root_namespace Yes Root class namespace that should be used for documentation
include Yes Defines what classes should be included in generated documentation (supports glob style wildcards syntax; each line means one rule)

evert/phpdoc-md 🔗

This engine first generates an XML data tree with the help of PHPDocumentator and then it is converted to MarkDown format, which is then uploaded to a project wiki. That's why is much slower than clean/phpdoc-md but generates much better results.

This engine supports such extra arguments:

Argument Required Default value Description
ignore_files No Defines files that can be ignored (supports glob rules; each line means one rule)

How to contribute?

If you want to add some functionality or fix bugs, you can fork, change and create pull request. If you not sure how this works, try interactive GitHub tutorial.

If you found any bug or have some questions, use issues tab and write there your questions.

You can’t perform that action at this time.