-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup - show diff and restrict pushing to only when in this PR pretty…
… much
- Loading branch information
1 parent
03e33bc
commit 6d07424
Showing
2 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,17 +38,27 @@ jobs: | |
set -o pipefail | ||
tools/bids-2.0/apply_all 2>&1 | tee /tmp/patch.log | ||
- name: "Push patched version online for possible introspection" | ||
# if: contains(github.ref, 'refs/heads/bids-2.0') | ||
- name: "Show differences after patching" | ||
run: | | ||
git add . | ||
git diff --cached | ||
- name: "Commit and push patched version online for possible introspection" | ||
# Run only on a non-merge commit for the PR | ||
if: > | ||
github.repository == 'bids-standard/bids-specification' && | ||
github.event.pull_request.head.ref == 'bids-2.0' && | ||
github.event.pull_request.merge_commit_sha != github.sha | ||
run: | | ||
set -x | ||
commit=$(git rev-parse HEAD) | ||
branch=$(git rev-parse --abbrev-ref HEAD)-patched | ||
branch=${GITHUB_HEAD_REF}-patched | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "BIDS 2.0 GitHub CI" | ||
git checkout -b "$branch" | ||
git add . | ||
{ | ||
echo -e "Applied patches for BIDS-2.0 to $commit\n"; | ||
cat /tmp/patch.log"; | ||
echo -e "Applied patches for ${GITHUB_HEAD_REF} to ${commit}\n"; | ||
cat /tmp/patch.log; | ||
} | git commit -F - | ||
git push -f origin "$branch" | ||
|