Update plugins database #1480
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: Update plugins database | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0/4 * * *" | |
jobs: | |
regenerate-database: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
# see details (matrix, python-version, python-version-file, etc.) | |
# https://github.com/actions/setup-python | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Setup a local virtual environment (if no poetry.toml file) | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install the project dependencies | |
run: poetry install | |
- name: Create env file | |
run: | | |
touch .env | |
echo CLIENT_ID=${{ secrets.CLIENT_ID }} >> .env | |
echo SECRET_ID=${{ secrets.SECRET_ID }} >> .env | |
echo CLIENT_ID2=${{ secrets.CLIENT_ID2 }} >> .env | |
echo SECRET_ID2=${{ secrets.SECRET_ID2 }} >> .env | |
echo CLIENT_ID3=${{ secrets.CLIENT_ID3 }} >> .env | |
echo SECRET_ID3=${{ secrets.SECRET_ID3 }} >> .env | |
echo CLIENT_ID4=${{ secrets.CLIENT_ID4 }} >> .env | |
echo SECRET_ID4=${{ secrets.SECRET_ID4 }} >> .env | |
cat .env | |
- name: Run pythonAuto | |
run: | | |
poetry run python generate_database.py | |
poetry run python db_checker.py | |
- name: Commit database changes | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
if [[ ! -z $(git status -s) ]]; then | |
git add database.json | |
git commit -m "chore: update plugins database" | |
git add README.md | |
git commit -m "chore: update readme stats" | |
git add dotfiles.json | |
git commit -m "chore: update dotfiles database" | |
fi | |
- name: Push regenerated database | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |