chore: rebuild project template for distribution operations #1
This file contains hidden or 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: Update OSS Licenses | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "**/pyproject.toml" | |
| - ".github/workflows/oss_licenses.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: oss-licenses-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| update-notice: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m venv .venv | |
| . .venv/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install pip-licenses | |
| - name: Generate OSS_LICENSES.md | |
| run: | | |
| . .venv/bin/activate | |
| pip-licenses --format=markdown > OSS_LICENSES.md | |
| - name: Commit and push if changed | |
| run: | | |
| if ! git diff --quiet; then | |
| git add OSS_LICENSES.md | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git commit -m "chore: update OSS_LICENSES.md" | |
| git push | |
| fi |