Skip to content

Commit

Permalink
Try automatic commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jslane-h committed Dec 20, 2024
1 parent 6bb9302 commit 7f38069
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,34 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and run unit test Dockerfile
uses: ./.github/actions/unit-test-action

- name: Check for changes in measure_check_output.txt
run: |
if grep -q "Changes detected" test_results/measure_check_output.txt; then
echo "Measure XML update required. Run 'openstudio measure -t ./lib/measures'"
exit 1
fi
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: test_results
path: ${{ github.workspace }}/test_results
path: ${{ github.workspace }}/test_results

# - name: Check for changes in measure_check_output.txt
# run: |
# if grep -q "Changes detected" test_results/measure_check_output.txt; then
# echo "Measure XML update required. Run 'openstudio measure -t ./lib/measures'"
# exit 1
# fi

- name: Commit and push changes
if: ${{ always() }} # Ensure this runs even if the previous steps modify files
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
if [ -n "$(git status --porcelain)" ]; then
git add -A
git commit -m "Auto-update by GitHub Actions"
git push origin HEAD
else
echo "No changes detected, skipping commit."
fi

0 comments on commit 7f38069

Please sign in to comment.