Update Projects Metadata #51
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 Projects Metadata | |
| on: | |
| schedule: | |
| # 毎日 0:00 UTC (日本時間 9:00) に実行 | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: # 手動実行を許可 | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'projects-list.txt' | |
| - 'scripts/fetch-metadata.py' | |
| jobs: | |
| update-metadata: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # リポジトリへの書き込み権限(コミット・プッシュ用) | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| pip install requests pyyaml | |
| - name: Fetch project metadata | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| python scripts/fetch-metadata.py | |
| - name: Commit and push if changed | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| if [[ -n $(git status -s) ]]; then | |
| git add projects.json | |
| git commit -m "🔄 Update projects metadata [automated]" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi |