Skip to content

Merge branch 'main' of https://github.com/NCAR/ucomp-configuration #296

Merge branch 'main' of https://github.com/NCAR/ucomp-configuration

Merge branch 'main' of https://github.com/NCAR/ucomp-configuration #296

name: Run Validator and Commit Changes
on:
push:
branches:
- main # Monitor pushes to the main branch
jobs:
run-validator:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Check out repository
uses: actions/checkout@v3
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
# Step 3: Install dependencies
- name: Install dependencies
run: |
python -m pip install numpy
python -m pip install matplotlib
# pip install -r requirements.txt
# Step 4: Run the validator script
- name: Run validator.py
run: |
python validation_scripts/validator.py # validator.py
# Step 5: Configure Git
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# Step 6: Check for Changes
- name: Check for changes
run: |
git add -A
git diff --cached --exit-code || echo "changes detected"
- name: Debug Outputs
run: |
echo "Changes-detected: ${{ steps.check_changes.outputs.changes-detected }}"
# Step 7: Commit and Push Changes
- name: Commit and push changes
#if: success() && steps['Check for changes'].outputs.changes-detected == true
run: |
git commit -m "Apply changes from validator.py"
git push origin main