Skip to content

Commit

Permalink
Adjust workflows to apply patches and push patched version as well fo…
Browse files Browse the repository at this point in the history
…r introspection
  • Loading branch information
yarikoptic committed Apr 27, 2024
1 parent d1341a7 commit e8e5f23
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/schemacode_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ jobs:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4

- name: "Apply patches for BIDS-2.0"
run: tools/bids-2.0/apply_all

- name: "Show differences after patching"
run: |
git add .
git diff --cached
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/validate_bids-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,35 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: "Apply patches for BIDS-2.0"
run: |
set -o pipefail
tools/bids-2.0/apply_all 2>&1 | tee /tmp/patch.log
- 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=${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"
{
echo -e "Applied patches for ${GITHUB_HEAD_REF} to ${commit}\n";
cat /tmp/patch.log;
} | git commit -F -
git push -f origin "$branch"
# Setup Python with bst
- uses: actions/setup-python@v5
with:
Expand Down

0 comments on commit e8e5f23

Please sign in to comment.