From 538df5213c4f2ce045e267ce5601c7160bcd93c9 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Mon, 10 Apr 2023 11:43:54 +0700 Subject: [PATCH] add update_wiki.yml --- .github/workflows/update_wiki.yml | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/update_wiki.yml diff --git a/.github/workflows/update_wiki.yml b/.github/workflows/update_wiki.yml new file mode 100644 index 00000000..132b3b6a --- /dev/null +++ b/.github/workflows/update_wiki.yml @@ -0,0 +1,36 @@ +name: update wiki + +on: + push: + branches: [ master ] + tags: ['*'] + workflow_dispatch: + +jobs: + Update-Wiki: + name: Update Wiki + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + path: code + - name: Checkout wiki + uses: actions/checkout@v3 + with: + repository: ${{github.repository}}.wiki + path: wiki + - name: Generate files + run: | + python3 "./code/man/docgen.py" -M "./code/man/CMDLINE.template.md" "./code/src/" > "./wiki/CMDLINE.md" + - name: Push to wiki + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + cd wiki + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git diff-index --quiet HEAD || git commit -m "Update CMDLINE.md" && git push