Password-related JSON Files #108
This file contains 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: 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@88bf0de51c7487d91e1abbb4899332e602c58bbf | |
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 }} |