mirror of
https://github.com/sokai/gh-stars.git
synced 2025-10-10 15:30:39 +02:00
Update update-by-lang.yml
Reset
This commit is contained in:
parent
97e2696831
commit
3a932a6731
1 changed files with 22 additions and 38 deletions
60
.github/workflows/update-by-lang.yml
vendored
60
.github/workflows/update-by-lang.yml
vendored
|
@ -1,50 +1,34 @@
|
||||||
name: ⭐ Update by language
|
name: Update by language
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [main]
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0/30 * * * *
|
- cron: 0/30 * * * *
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
jobs:
|
||||||
update-by-language:
|
update-by-language:
|
||||||
env:
|
name: update awesome-stars
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
REPOSITORY: ${{ github.repository }}
|
|
||||||
USERNAME: ${{ github.repository_owner }}
|
|
||||||
name: 🌟 Update stars and clean old runs
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 🧹 Delete old workflow runs
|
- uses: actions/checkout@v5
|
||||||
run: |
|
- name: Set up Python
|
||||||
gh api repos/${REPOSITORY}/actions/runs -X GET --paginate -q '.workflow_runs[] | select(.status != "in_progress" and .status != "queued") | "\(.id)"' | xargs -I % gh api repos/${REPOSITORY}/actions/runs/% -X DELETE
|
|
||||||
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: 🔧 Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
|
- name: Install dependencies
|
||||||
- name: 🔧 Install dependencies
|
run: |
|
||||||
run: pip install --upgrade pip starred
|
python -m pip install --upgrade pip
|
||||||
|
pip install starred
|
||||||
- name: ⭐ Update repo category by language
|
- name: Get repository name
|
||||||
|
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
|
||||||
|
- name: Update repo category by language
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
REPOSITORY: ${{ env.REPOSITORY_NAME }}
|
||||||
|
USERNAME: ${{ github.repository_owner }}
|
||||||
run: |
|
run: |
|
||||||
starred \
|
starred \
|
||||||
--token ${GITHUB_TOKEN} \
|
--username ${USERNAME} \
|
||||||
--username ${USERNAME} \
|
--repository ${REPOSITORY} \
|
||||||
--sort > by-language.md
|
--token ${GITHUB_TOKEN} \
|
||||||
head by-language.md
|
--sort \
|
||||||
if [ $(wc -l < "by-language.md") -lt 100 ]; then
|
--message "docs(language): bump data" \
|
||||||
git checkout -- "by-language.md"
|
--filename 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