name: Update Dataset Site Template on: workflow_dispatch: repository_dispatch: types: [dataset-site-template-update] jobs: generate: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 with: ref: master - name: Setup Node.js 14.x uses: actions/setup-node@v1 with: node-version: 14.x - name: Update dataset site template to latest version run: npx @openactive/dataset-site-template@latest --raw "./lib/openactive/dataset_site/" working-directory: ./ - name: git stash if material changes have not been made # When considering whether it's worth making a PR, ignore the following: # - The dataset-site-template minor or patch version number updating within the template in datasetsite.mustache and datasetsite-csp.mustache (affects one line) # - Any updates to datasetsite-csp.static.zip # git stashing if no material changes allows the next step to close the PR if one is already open run: if [ "$(git diff --numstat | grep -vc '^1\s.*datasetsite\.mustache\|1\s.*datasetsite-csp\.mustache\|.*datasetsite-csp\.static\.zip$')" -eq "0" ]; then git stash; else echo "Material changes found"; fi working-directory: ./ - name: Create Pull Request id: cpr uses: peter-evans/create-pull-request@v3 with: path: ./ token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} commit-message: Update dataset site template committer: openactive-bot author: openactive-bot signoff: false branch: ci/update-data-models delete-branch: true title: 'Update dataset site template' body: | Update to the latest version of the [Dataset Site Template](https://github.com/openactive/dataset-site-template) **Reviewer note:** Major version numbers of this library should match those of the `dataset-site-template` on which this library depends. Any updates to the dataset site template files or assets should always be a major version update in both libraries. Hence this PR, once merged, should be released with a major version bump to match its contents. Therefore, the major version number in the file `lib/openactive/dataset_site/version.rb` should be bumped in this branch before the PR is merged. labels: | automated pr team-reviewers: | owners maintainers draft: false - name: Check outputs run: | echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"