Skip to content

Password-related JSON Files #502

Password-related JSON Files

Password-related JSON Files #502

name: Password-related JSON Files
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *' # every morning at 3am UTC
jobs:
update:
name: Get latest password-related json files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Get latest files
run: cd packages/password && npm run files:update
- name: Check for changes
id: changes
run: |
filesChanged=$(sh ./scripts/check-for-changes.sh)
if [ -z "$filesChanged" ]; then hasChanged="false"; else hasChanged="true"; fi
echo "hasChanged=$hasChanged" >> "$GITHUB_OUTPUT"
shell: bash {0}
- name: Get current date
id: date
run: |
echo "currentDate=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Update build if needed
if: ${{ steps.changes.outputs.hasChanged == 'true' }}
run: |
npm ci
npm run build
- name: Create PR for updated files
if: ${{ steps.changes.outputs.hasChanged == 'true' }}
uses: peter-evans/create-pull-request@b3a2c5d525a1eb75e75c781e45a1bf3bfc23bdc6
with:
add-paths: |
packages/password/rules.json
packages/password/shared-credentials.json
dist/
swift-package/
commit-message: Update password-related json files
branch: automated/update-password-json-files-${{ steps.date.outputs.currentDate }}
title: 'Update password-related json files (${{steps.date.outputs.currentDate}})'
body: 'Updating password-related json files from remote source, pulled on ${{steps.date.outputs.currentDate}}'
token: ${{ secrets.DAXMOBILE_AUTOFILL_AUTOMATION }}