From 800be7b179d7868d8e257278833cae10acc68d01 Mon Sep 17 00:00:00 2001 From: Bin Yang Date: Fri, 2 Apr 2021 15:10:44 -0400 Subject: [PATCH] setup separate workflow to generate wiki on every push --- .github/workflows/repo_status_weekly.yml | 11 ------- .github/workflows/wiki_gen_daily.yml | 37 ++++++++++++++++++++++++ wiki_gen.py | 4 +-- 3 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/wiki_gen_daily.yml diff --git a/.github/workflows/repo_status_weekly.yml b/.github/workflows/repo_status_weekly.yml index 5126ddb..18b2bf8 100644 --- a/.github/workflows/repo_status_weekly.yml +++ b/.github/workflows/repo_status_weekly.yml @@ -33,18 +33,7 @@ jobs: env: GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - - name: execute py script # run the run.py to get the latest data - run: | - python wiki_gen.py - - name: Commit & Push changes uses: actions-js/push@master with: github_token: ${{ secrets.GIT_TOKEN }} - - - name: Upload Documentation to Wiki - uses: SwiftDocOrg/github-wiki-publish-action@v1 - with: - path: "generated_wiki" - env: - GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GIT_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/wiki_gen_daily.yml b/.github/workflows/wiki_gen_daily.yml new file mode 100644 index 0000000..1bbf7cf --- /dev/null +++ b/.github/workflows/wiki_gen_daily.yml @@ -0,0 +1,37 @@ +name: Wiki-Generator + +# generate wiki page on every push +on: push + +jobs: + # Set the job key. The key is displayed as the job name + update-repo-status: + # Name the Job + name: Update repo status for all saved repo + # Set the type of machine to run on + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: setup python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: execute py script # run the run.py to get the latest data + run: | + python wiki_gen.py + + - name: Upload Documentation to Wiki + uses: SwiftDocOrg/github-wiki-publish-action@v1 + with: + path: "generated_wiki" + env: + GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GIT_TOKEN }} \ No newline at end of file diff --git a/wiki_gen.py b/wiki_gen.py index d9027d9..9b65210 100644 --- a/wiki_gen.py +++ b/wiki_gen.py @@ -8,9 +8,9 @@ from git_status import get_repo_list def get_wiki_status_color(input_text): if input_text is None or input_text == 'inactive': - result_text = "![inactive](https://placehold.it/15/FF0000/000000?text=+)" + result_text = ":heavy_multiplication_x:" else: - result_text = "![active](https://placehold.it/15/00FF00/000000?text=+)" + result_text = ":heavy_check_mark:" return '{}'.format(result_text)