Fixing auto-checkout issues
Some checks failed
Merge-Checker / build_and_test (pull_request) Failing after 22s
Some checks failed
Merge-Checker / build_and_test (pull_request) Failing after 22s
This commit is contained in:
@@ -50,18 +50,30 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- name: Commit and push timing results
|
- name: Commit and push timing results
|
||||||
if: github.event.pull_request.head.repo.full_name == github.repository # Only push from same repo
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "ci-bot"
|
git config --global user.name "ci-bot"
|
||||||
git config --global user.email "ci-bot@local"
|
git config --global user.email "ci-bot@local"
|
||||||
|
|
||||||
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
|
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
|
||||||
|
|
||||||
|
echo "Checking if last commit was a timing update"
|
||||||
|
LAST_COMMIT_MSG=$(git log -1 --pretty=%B)
|
||||||
|
|
||||||
|
if echo "$LAST_COMMIT_MSG" | grep -q "Update matrix-timing-tests timings"; then
|
||||||
|
echo "Last commit was a timing update, skipping commit."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Checking out source branch $BRANCH_NAME"
|
||||||
|
git fetch origin "$BRANCH_NAME"
|
||||||
|
git checkout -B "$BRANCH_NAME" "origin/$BRANCH_NAME"
|
||||||
|
|
||||||
git add unit-tests/timing-results/matrix-timing-tests.txt
|
git add unit-tests/timing-results/matrix-timing-tests.txt
|
||||||
|
|
||||||
if git diff --quiet --cached; then
|
if git diff --quiet --cached; then
|
||||||
echo "No changes to commit"
|
echo "No changes to commit"
|
||||||
else
|
else
|
||||||
git commit -m "Update matrix-timing-tests timings [skip ci]"
|
git commit -m "Update matrix-timing-tests timings [skip ci]"
|
||||||
git push origin HEAD:$BRANCH_NAME
|
git push origin "$BRANCH_NAME"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user