Update Node dependencies (daily) #88
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 Node dependencies (daily) | |
| on: | |
| schedule: | |
| - cron: "0 2 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: update-node-deps | |
| cancel-in-progress: true | |
| jobs: | |
| update-deps: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install Playwright system dependencies | |
| run: sudo npx playwright install-deps | |
| - name: Update dependencies | |
| run: | | |
| npm install | |
| - name: Install Playwright browsers | |
| run: npx playwright install | |
| - name: Run tests | |
| run: npx playwright test | |
| - name: Commit and push if there are changes | |
| shell: bash | |
| env: | |
| GH_PAT: ${{ secrets.ACTIONS_PUSH_PAT }} | |
| run: | | |
| set -euo pipefail | |
| git config user.name "agray" | |
| git config user.email "agray@users.noreply.github.com" | |
| export GIT_AUTHOR_NAME="agray" | |
| export GIT_AUTHOR_EMAIL="agray@users.noreply.github.com" | |
| export GIT_COMMITTER_NAME="agray" | |
| export GIT_COMMITTER_EMAIL="agray@users.noreply.github.com" | |
| git add -A | |
| if git diff --cached --quiet; then | |
| echo "✅ No changes detected after running sync-package-versions.ps1" | |
| exit 0 | |
| fi | |
| git commit -m "Automated version sync" | |
| git pull --rebase origin main | |
| echo "🔐 Using PAT to push changes..." | |
| git push "https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}" HEAD:main | |
| echo "🚀 Changes committed and pushed to main via PAT." |