diff options
author | Théo Zimmermann <theo.zimmermann@univ-paris-diderot.fr> | 2018-06-08 21:38:47 +0200 |
---|---|---|
committer | Théo Zimmermann <theo.zimmermann@univ-paris-diderot.fr> | 2018-06-09 10:17:15 +0200 |
commit | a070ba052dd097f6fdb433e8f74b8bdd90d3d7c4 (patch) | |
tree | 69e394e11e1b126be80a338847d8d085bfbe67ea /dev | |
parent | ded7ac52847670a6f4f51671e2101a4fdd13a29e (diff) |
[merge script] Check if the CI that was run is outdated.
[ci skip]
Diffstat (limited to 'dev')
-rwxr-xr-x | dev/tools/merge-pr.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dev/tools/merge-pr.sh b/dev/tools/merge-pr.sh index 00d04e6b3..320ef6ed0 100755 --- a/dev/tools/merge-pr.sh +++ b/dev/tools/merge-pr.sh @@ -140,6 +140,24 @@ if [ "$LOCAL_BRANCH_COMMIT" != "$UPSTREAM_COMMIT" ]; then fi fi +# Sanity check: PR has an outdated version of CI + +BASE_COMMIT=$(echo "$PRDATA" | jq -r '.base.sha') +CI_FILES=(".travis.yml" ".gitlab-ci.yml" "appveyor.yml") + +if ! git diff --quiet "$BASE_COMMIT" "$LOCAL_BRANCH_COMMIT" -- "${CI_FILES[@]}" +then + warning "This PR didn't run with the latest version of CI." + warning "It is probably a good idea to ask for a rebase." + read -p "Do you want to see the diff? [Y/n] " $QUICK_CONF -r + echo + if [[ ! $REPLY =~ ^[Nn]$ ]] + then + git diff "$BASE_COMMIT" "$LOCAL_BRANCH_COMMIT" -- "${CI_FILES[@]}" + fi + ask_confirmation +fi + # Sanity check: CI failed STATUS=$(curl -s "$API/commits/$COMMIT/status") |