Create report.yml

Generate daily reports from issues.
This commit is contained in:
Graham Wheeler 2022-03-15 21:11:03 -07:00 committed by GitHub
parent 328d4026b1
commit 75e8f31d11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

56
.github/workflows/report.yml vendored Normal file
View file

@ -0,0 +1,56 @@
name: 'Generate Daily Report'
on:
schedule:
- cron: '0 5 * * *'
jobs:
report:
runs-on: ubuntu-18.04
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install reporter
run:
python -m pip install ghreport
- name: Generate report
run: |
mkdir -p reports
ghreport -o reports/report%a.md $env.GITHUB_REPOSITORY ${{ secrets.GITHUB_TOKEN }}
- name: Commit report
id: commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "github-actions"
git add reports
if [-z "$(git status --porcelain)"]; then
echo "::set-output name=push::false"
else
git commit -m "Daily report update" -a
echo "::set-output name=push::true"
fi
shell: bash
- name: Push changes
if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}