Skip to content

Commit

Permalink
github action to update validator version
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-nhs committed Oct 28, 2024
1 parent 0fbdf9d commit b3e71b1
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/update_validator_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Update Validator Versions

on:
workflow_dispatch:
pull_request:
branches: [master]

jobs:
update-validator:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout master branch
uses: actions/checkout@v3
with:
ref: master

- name: Set up date-time branch name
id: datetime
run: |
# shellcheck disable=SC2086
echo "BRANCH_NAME=update-validator-$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV
- name: Create and switch to new branch
run: |
git checkout -b "$BRANCH_NAME"
- name: Run update script
run: ./scripts/update_validator_versions.sh

- name: Check for changes
run: |
if git diff --quiet; then
echo "No changes to commit."
exit 0
fi
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit changes
run: |
git add .
git commit -m "Update validator versions on $BRANCH_NAME"
- name: Push new branch to repository
run: |
git push origin "$BRANCH_NAME"
- name: Create pull request
uses: peter-evans/[email protected]
with:
base: master
branch: "$BRANCH_NAME"
title: "Upgrade: [dependabot] - bump fhir validator to <NEW VERSION>"
body: "This PR was automatically created by GitHub Actions to update validator versions."
commit-message: "Update validator versions on $BRANCH_NAME"
sign-commits: true

0 comments on commit b3e71b1

Please sign in to comment.