Skip to content

Generate Report

Generate Report #1014

name: Generate Report
on:
schedule:
- cron: "0 12 * * *" # Runs every day at 1200 UTC
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Execute Python script
run: |
python3 test.py
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXCLUDED: ${{ secrets.EXCLUDED }}
EXCLUDED_LANGS: ${{ secrets.EXCLUDED_LANGS }}
COUNT_STATS_FROM_FORKS: ${{ secrets.COUNT_STATS_FROM_FORKS }}
# Commits all changed files to the repository
- name: Commit to the output branch of repo
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m 'Generated Report' || echo
git push
# "echo" returns true so the build succeeds, even if no changed files
git commit -m 'Generated Report' || echo
git push
- name: Markdown autodocs
uses: dineshsonachalam/markdown-autodocs@v1.0.4
with:
# Optional, defaults to author of the commit that triggered the run
commit_author: Author <github-actions[bot]>
# Optional, defaults to "actions@github.com"
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
# Optional, but recommended
# Defaults to "Apply automatic changes"
commit_message: Report generated to README
branch: main
# Optional output file paths, defaults to '[./README.md]'.
output_file_paths: '[README.md]'
# Categories to automatically sync or transform its contents in the markdown files.
# Defaults to '[code-block,json-to-html-table,workflow-artifact-table]'
categories: '[code-block,json-to-html-table,workflow-artifact-table]'