Update Validation Patterns #13
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: Update Validation Patterns | |
on: | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v3 | |
- name: Fetch third-party metadata | |
run: | | |
curl -o resources/metadata.xml https://raw.githubusercontent.com/google/libphonenumber/master/resources/PhoneNumberMetadata.xml | |
- name: Update metadata | |
run: | | |
python scripts/prepare-metadata | |
- name: Compare metadata | |
id: compare | |
run: | | |
git diff --exit-code resources/metadata.xml || echo "::set-output name=differs::true" | |
- name: Create Pull Request | |
if: steps.compare.outputs.differs == 'true' | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
branch-suffix: short-commit-hash | |
branch: update-validation-patterns | |
title: Update the validation patterns | |
commit-message: Update the validation patterns | |
body: This PR updates the validation patterns i.e. metadata.xml to keep the repository up-to-date with the upstream changes. |