Some checks are pending
CI / ruff (push) Waiting to run
CI / mypy (push) Waiting to run
CI / pytest (push) Waiting to run
CI / package (push) Waiting to run
CI / Install smoke (${{ matrix.label }}) (linux, ubuntu-latest) (push) Blocked by required conditions
CI / Install smoke (${{ matrix.label }}) (macos-arm64, macos-14) (push) Blocked by required conditions
39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
name: Update star history chart
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
update-chart:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.repository.default_branch }}
|
|
|
|
- name: Generate chart
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: python3 .github/scripts/star_history.py "${{ github.repository }}" assets/star-history.svg
|
|
|
|
- name: Commit to update branch if changed
|
|
env:
|
|
BASE_BRANCH: ${{ github.event.repository.default_branch }}
|
|
UPDATE_BRANCH: star-history-update-${{ github.run_id }}-${{ github.run_attempt }}
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git add assets/star-history.svg
|
|
if ! git diff --cached --quiet; then
|
|
git commit -m "chore: update star history chart [skip ci]"
|
|
git push origin "HEAD:refs/heads/${UPDATE_BRANCH}"
|
|
pr_url="https://github.com/${{ github.repository }}/compare/${BASE_BRANCH}...${UPDATE_BRANCH}?expand=1"
|
|
echo "Open a PR: ${pr_url}"
|
|
echo "Open a PR: [${UPDATE_BRANCH}](${pr_url})" >> "$GITHUB_STEP_SUMMARY"
|
|
else
|
|
echo "No changes"
|
|
fi
|