This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (48 loc) · 1.65 KB
/
timetracking.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Export timetracking statistics
on:
schedule:
- cron: '0 23 * * 2'
workflow_dispatch:
jobs:
generate:
runs-on: [self-hosted]
permissions:
pull-requests: write
contents: write
environment: timetracking-prod
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout new branch
run: |
git checkout -b actions/timetracking-${{ github.run_id }}
git push --set-upstream origin actions/timetracking-${{ github.run_id }}
- name: Fetch the current timetracking data
run: cd docs/project/timetracking && ./get_data.sh
env:
KIMAI_API_TOKEN: ${{ secrets.KIMAI_API_TOKEN }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pandas numpy matplotlib
- name: Generate the desired charts
run: cd docs/project/timetracking && python generate_charts.py
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
- name: Push changes
run: git push
- name: 'Checkout the new branch'
uses: actions/checkout@v4
with:
ref: 'actions/new-timetracking-data'
- name: 'Create a new Pull Request'
run: gh pr create -a benedictweis -B main -H "actions/timetracking-${{ github.run_id }}" --title "Update timetracking data" --body "Automated PR"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.html_url }}