Skip to content

Commit db953ba

Browse files
Apply Zhian's suggestions
Co-authored-by: Zhian N. Kamvar <[email protected]>
1 parent d3f553d commit db953ba

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/template.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
- name: Sync lesson with carpentries/styles
7878
working-directory: lesson
7979
run: |
80+
echo "::group::Fetch Styles"
8081
if [[ -n "${{ github.event.pull_request.number }}" ]]
8182
then
8283
ref="refs/pull/${{ github.event.pull_request.number }}/head"
@@ -89,31 +90,38 @@ jobs:
8990
9091
git remote add styles https://github.com/carpentries/styles.git
9192
git fetch styles $ref:styles-ref
92-
93+
echo "::endgroup::"
94+
echo "::group::Synchronize Styles"
9395
# Sync up only if necessary
9496
if [[ $(git rev-list --count HEAD..styles-ref) != 0 ]]
9597
then
9698
9799
# The merge command below might fail for lessons that use remote theme
98100
# https://github.com/carpentries/carpentries-theme
101+
echo "Testing merge using recursive strategy, accepting upstream changes without committing"
99102
if ! git merge -s recursive -Xtheirs --no-commit styles-ref
100103
then
101104
102105
# Remove "deleted by us, unmerged" files from the staging area.
103106
# these are the files that were removed from the lesson
104107
# but are still present in the carpentries/styles repo
108+
echo "Removing previously deleted files"
105109
git rm $(git diff --name-only --diff-filter=DU)
106110
107111
# If there are still "unmerged" files,
108112
# let's raise an error and look into this more closely
109113
if [[ -n $(git diff --name-only --diff-filter=U) ]]
110114
then
115+
echo "There were unmerged files in ${{ matrix.lesson-name }}:"
116+
echo "$(git diff --compact-summary --diff-filter=U)"
111117
exit 1
112118
fi
113119
fi
114120
121+
echo "Committing changes"
115122
git commit -m "Sync lesson with carpentries/styles"
116123
fi
124+
echo "::endgroup::"
117125
118126
- name: Look for R-markdown files
119127
id: check-rmd

0 commit comments

Comments
 (0)