|
| 1 | +name: Update Plugins |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 6 * * *' # Daily at 06:00 UTC |
| 6 | + workflow_dispatch: # Allow manual trigger |
| 7 | + |
| 8 | +jobs: |
| 9 | + update-plugins: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Check out etherpad-lite |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - uses: pnpm/action-setup@v3 |
| 16 | + name: Install pnpm |
| 17 | + with: |
| 18 | + version: 10 |
| 19 | + run_install: false |
| 20 | + |
| 21 | + - name: Use Node.js |
| 22 | + uses: actions/setup-node@v4 |
| 23 | + with: |
| 24 | + node-version: 22 |
| 25 | + |
| 26 | + - name: Install bin dependencies |
| 27 | + working-directory: ./bin |
| 28 | + run: pnpm install |
| 29 | + |
| 30 | + - name: Configure git |
| 31 | + run: | |
| 32 | + git config --global user.name 'github-actions[bot]' |
| 33 | + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' |
| 34 | +
|
| 35 | + - name: Clone and update all plugins |
| 36 | + env: |
| 37 | + GH_TOKEN: ${{ secrets.PLUGINS_PAT }} |
| 38 | + run: | |
| 39 | + # Configure git to use the PAT for all ether/ repos |
| 40 | + git config --global url."https://x-access-token:${GH_TOKEN}@github.com/ether/".insteadOf "https://github.com/ether/" |
| 41 | +
|
| 42 | + cd .. |
| 43 | + # List all ep_* repos from ether org |
| 44 | + plugins=$(gh repo list ether --limit 200 --json name --jq '.[] | select(.name | startswith("ep_")) | .name') |
| 45 | +
|
| 46 | + for plugin in $plugins; do |
| 47 | + echo "============================================================" |
| 48 | + echo "Processing $plugin" |
| 49 | + echo "============================================================" |
| 50 | +
|
| 51 | + # Clone if not present |
| 52 | + if [ ! -d "$plugin" ]; then |
| 53 | + git clone "https://github.com/ether/${plugin}.git" "$plugin" || { echo "SKIP: clone failed"; continue; } |
| 54 | + fi |
| 55 | +
|
| 56 | + # Pull latest |
| 57 | + (cd "$plugin" && git pull --ff-only) || { echo "SKIP: pull failed"; continue; } |
| 58 | +
|
| 59 | + # Run checkPlugin with autopush |
| 60 | + cd etherpad-lite/bin |
| 61 | + pnpm run checkPlugin "$plugin" autopush 2>&1 | tail -20 || echo "WARN: checkPlugin failed for $plugin" |
| 62 | + cd ../.. |
| 63 | + done |
0 commit comments