update-jquery-validate.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Update jquery-validation
  2. on:
  3. schedule:
  4. - cron: '0 0 1 * *' # Run on the first day of the month
  5. workflow_dispatch: # Allow manual runs
  6. permissions:
  7. contents: write
  8. issues: write
  9. pull-requests: write
  10. jobs:
  11. update-jquery-validate:
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Checkout code
  15. uses: actions/checkout@v4
  16. - name: Setup Node.js
  17. uses: actions/setup-node@v4
  18. with:
  19. node-version: '20.x'
  20. - name: Set RepoRoot
  21. run: echo "RepoRoot=$(pwd)" >> $GITHUB_ENV
  22. - name: Update dependencies
  23. working-directory: ${{ env.RepoRoot }}/src/Mvc/build
  24. run: |
  25. npm install --no-lockfile
  26. npm run build
  27. npm run update-identity-ui-scripts
  28. echo "JQUERY_VALIDATE_VERSION=$(npm ls jquery-validation --json | jq -r '.dependencies["jquery-validation"].version')" >> $GITHUB_ENV
  29. - name: Update script tags
  30. working-directory: ${{ env.RepoRoot }}/src/Identity/UI
  31. run: node update-jquery-validate.mjs
  32. - name: Create Pull Request
  33. uses: dotnet/actions-create-pull-request@v4
  34. with:
  35. token: ${{ secrets.GITHUB_TOKEN }}
  36. commit-message: Update jquery.validate to ${{ env.JQUERY_VALIDATE_VERSION }}
  37. title: '[Templates][Identity] Update jquery-validation to ${{ env.JQUERY_VALIDATE_VERSION }}'
  38. body: |
  39. Updates the jquery-validation scripts to ${{ env.JQUERY_VALIDATE_VERSION }}
  40. branch: update-jquery-validate-to-${{ env.JQUERY_VALIDATE_VERSION }}
  41. paths: |
  42. **/jquery.validate.js
  43. **/jquery.validate.min.js
  44. **/*.cshtml
  45. src/Identity/UI/jquery-validate-versions.json