mirror of
https://github.com/sokai/gh-stars.git
synced 2025-10-10 23:40:39 +02:00
Update update-by-lang.yml
* Better commits
* Ref: 2c5034e334/.github/workflows/main.yml
This commit is contained in:
parent
8e57452c37
commit
a94ccb431d
1 changed files with 42 additions and 24 deletions
66
.github/workflows/update-by-lang.yml
vendored
66
.github/workflows/update-by-lang.yml
vendored
|
@ -1,34 +1,52 @@
|
||||||
name: Update by language
|
name: ⭐ Update by language
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
push:
|
||||||
|
branches: [main]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0/30 * * * *
|
- cron: 0/30 * * * *
|
||||||
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
update-by-language:
|
update-by-language:
|
||||||
name: update awesome-stars
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
REPOSITORY: ${{ env.REPOSITORY_NAME }}
|
||||||
|
USERNAME: ${{ github.repository_owner }}
|
||||||
|
name: 🌟 Update stars and clean old runs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: 🧹 Delete old workflow runs
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: "3.10"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
gh api repos/${{ github.repository }}/actions/runs --paginate -q '.workflow_runs[] \
|
||||||
pip install starred
|
| select(.status != "in_progress" and .status != "queued") | "\(.id)"' \
|
||||||
- name: Get repository name
|
| xargs -I % gh api repos/${{ github.repository }}/actions/runs/% -X DELETE
|
||||||
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
|
|
||||||
- name: Update repo category by language
|
- name: ⬇ Checkout
|
||||||
env:
|
uses: actions/checkout@v5
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
REPOSITORY: ${{ env.REPOSITORY_NAME }}
|
- name: 🔧 Set up Python
|
||||||
USERNAME: ${{ github.repository_owner }}
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.13"
|
||||||
|
|
||||||
|
- name: 🔧 Install dependencies
|
||||||
|
run: pip install --upgrade pip starred
|
||||||
|
|
||||||
|
- name: ⭐ Update repo category by language
|
||||||
run: |
|
run: |
|
||||||
starred \
|
starred \
|
||||||
--username ${USERNAME} \
|
--token ${GITHUB_TOKEN} \
|
||||||
--repository ${REPOSITORY} \
|
--username ${USERNAME} \
|
||||||
--token ${GITHUB_TOKEN} \
|
--sort > by-language.md
|
||||||
--sort \
|
head by-language.md
|
||||||
--message "docs(language): bump data" \
|
if [ $(wc -l < "by-language.md") -lt 100 ]; then
|
||||||
--filename by-language.md
|
git checkout -- "by-language.md"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 🤖 Commit changes
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
|
with:
|
||||||
|
commit_message: 🤖 Update generated README/topics
|
||||||
|
branch: main
|
||||||
|
commit_user_name: awesome-stars 🤖
|
||||||
|
commit_user_email: actions@github.com
|
||||||
|
commit_author: awesome-stars 🤖 <actions@github.com>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue