Weekly Commit Report #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Weekly Commit Report" | |
on: | |
push: | |
paths: | |
- ".github/workflows/weekly-report.yaml" | |
schedule: | |
- cron: "30 10 * * 5" # Set the workflow to run at 10:00 UTC+0 every Friday (6 PM Beijing time) | |
workflow_dispatch: # Allow to manually trigger the workflow | |
jobs: | |
generate-weekly-report: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
pull-requests: write | |
env: | |
PYTHONPATH: /home/runner/work/hoa-moe/hoa-moe | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Set execute permissions | |
run: find ./scripts \( -name "*.sh" -o -name "*.py" \) -exec chmod +x {} \; | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r scripts/requirements.txt | |
- name: Generate weekly report | |
env: | |
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
ORG_NAME: HITSZ-OpenAuto | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} # Add your OpenAI API key as a secret | |
NEWS_TYPE: weekly | |
run: | | |
python scripts/news/gen_news.py | |
- name: Commit and push changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: "content/news" | |
pull: "--rebase --autostash" | |
default_author: github_actions | |
message: "ci: update weekly report" | |
# - name: Create pull request | |
# uses: peter-evans/create-pull-request@v6 | |
# with: | |
# commit-message: 'docs: new weekly report' | |
# committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
# author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | |
# branch: weekly-report | |
# title: 'Weekly Report' | |
# body: 'This is the weekly report for the current week, automatically generated by GitHub Actions.' |