Update autoupdate_schema_version.yaml #1
Workflow file for this run
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 Schema Versions | |
on: | |
push: | |
branches: [ test-ga ] | |
jobs: | |
update-schema-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetches the entire history for comprehensive CI checks | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Fetch the latest release from ReproNim/reproschema | |
id: fetch-latest-release | |
run: | | |
LATEST_RELEASE=$(curl -s https://api.github.com/repos/ReproNim/reproschema/releases/latest | jq -r '.tag_name') | |
echo "LATEST_RELEASE=$LATEST_RELEASE" >> $GITHUB_ENV | |
- name: Update schema versions in files | |
run: python update_schema_version.py | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -u | |
if git diff --staged --quiet; then | |
echo "No changes to commit" | |
else | |
git commit -m "Update schema versions to $LATEST_RELEASE" | |
git push | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |