Transform Plugin Data #2012
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: Transform Plugin Data | |
| on: | |
| schedule: | |
| # 每小时执行一次 (UTC时间) | |
| - cron: '0 * * * *' | |
| workflow_dispatch: # 允许手动触发 | |
| permissions: | |
| contents: write | |
| actions: read | |
| jobs: | |
| transform-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PAT_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: bash "scripts/transform_plugin_data/configure_git/run.sh" | |
| - name: Fetch original plugin data | |
| id: fetch-data | |
| run: bash "scripts/transform_plugin_data/fetch_original_plugin_data/run.sh" | |
| env: | |
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| - name: Load existing cache for fallback | |
| if: steps.fetch-data.outputs.should_update == 'true' | |
| id: load-cache | |
| run: bash "scripts/transform_plugin_data/load_existing_cache_for_fallback/run.sh" | |
| - name: Get GitHub API info for repositories | |
| if: steps.fetch-data.outputs.should_update == 'true' | |
| id: get-repo-info | |
| run: bash "scripts/transform_plugin_data/get_github_api_info_for_repositories/run.sh" | |
| env: | |
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| HAS_EXISTING_CACHE: ${{ steps.load-cache.outputs.has_existing_cache }} | |
| - name: Transform plugin data | |
| if: steps.fetch-data.outputs.should_update == 'true' | |
| run: bash "scripts/transform_plugin_data/transform_plugin_data/run.sh" | |
| - name: Pull latest changes before checking (rebase with autostash) | |
| run: bash "scripts/transform_plugin_data/pull_latest_changes_before_checking_rebase_with_autostash/run.sh" | |
| - name: Check for changes | |
| if: steps.fetch-data.outputs.should_update == 'true' | |
| id: git-check | |
| run: bash "scripts/transform_plugin_data/check_for_changes/run.sh" | |
| - name: Commit and push changes | |
| if: steps.fetch-data.outputs.should_update == 'true' && steps.git-check.outputs.has_changes == 'true' | |
| run: bash "scripts/transform_plugin_data/commit_and_push_changes/run.sh" | |
| - name: Clean up | |
| if: always() | |
| run: bash "scripts/transform_plugin_data/clean_up/run.sh" | |
| - name: Summary | |
| if: always() | |
| run: bash "scripts/transform_plugin_data/summary/run.sh" | |
| env: | |
| SHOULD_UPDATE: ${{ steps.fetch-data.outputs.should_update }} | |
| HAS_CHANGES: ${{ steps.git-check.outputs.has_changes }} |