Skip to content

Commit 2ed5067

Browse files
committed
try and fix boilerplate sync
1 parent cf197ed commit 2ed5067

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/sync-boilerplate-cha.yaml

+17-19
Original file line numberDiff line numberDiff line change
@@ -43,48 +43,46 @@ jobs:
4343
git checkout main
4444
cd -
4545
46-
- name: Copy and Apply Changes to Create-Hyperweb-App
47-
run: |
48-
rsync -av --exclude='.git' ./ ../create-hyperweb-app/templates/hyperweb/ --delete
49-
50-
- name: Get Version from package.json
46+
- name: Get Version from Synced package.json
5147
id: get_version
5248
run: |
53-
if [ ! -f ../create-hyperweb-app/cha/package.json ]; then
49+
if [ ! -f ../create-hyperweb-app/templates/hyperweb/package.json ]; then
5450
echo "package.json not found!"
5551
exit 1
5652
fi
57-
VERSION=$(jq -r .version ../create-hyperweb-app/cha/package.json)
53+
VERSION=$(jq -r .version ../create-hyperweb-app/templates/hyperweb/package.json)
5854
echo "version=$VERSION" >> $GITHUB_OUTPUT
5955
56+
- name: Copy and Apply Changes to Create-Hyperweb-App
57+
run: |
58+
rsync -av --exclude='.git' ./ ../create-hyperweb-app/templates/hyperweb/ --delete
59+
6060
- name: Update Version in package.json
6161
run: |
6262
cd ../create-hyperweb-app
63-
if [ -f cha/package.json ]; then
63+
if [ -f templates/hyperweb/package.json ]; then
6464
# Update the version in package.json (increment or set the value as needed)
6565
NEW_VERSION="${{ steps.get_version.outputs.version }}"
66-
jq ".version = \"$NEW_VERSION\"" cha/package.json > tmp.json && mv tmp.json cha/package.json
66+
jq ".version = \"$NEW_VERSION\"" templates/hyperweb/package.json > tmp.json && mv tmp.json templates/hyperweb/package.json
6767
else
6868
echo "package.json not found!"
6969
exit 1
7070
fi
7171
72-
- name: Get Changelog File
73-
run: |
74-
if [ -f ../create-hyperweb-app/cha/CHANGELOG.md ]; then
75-
cp ../create-hyperweb-app/cha/CHANGELOG.md ../create-hyperweb-app/templates/hyperweb/
76-
else
77-
echo "CHANGELOG.md not found!"
78-
fi
79-
8072
- name: Commit and Push Changes
8173
run: |
8274
cd ../create-hyperweb-app
75+
# Get the short commit hash from the hyperweb-boilerplate repository
76+
SHORT_HASH=$(git -C ../hyperweb-boilerplate rev-parse --short HEAD)
77+
78+
# Add changes
8379
git add .
80+
81+
# Check if there are any changes to commit
8482
if ! git diff-index --quiet HEAD; then
85-
NEW_BRANCH="sync/hyperweb-boilerplate-update-${{ steps.get_version.outputs.version }}-$(date +%Y%m%d%H%M)"
83+
NEW_BRANCH="sync/hyperweb-boilerplate-update-${SHORT_HASH}-$(date +%Y%m%d%H%M)"
8684
git checkout -b $NEW_BRANCH
87-
git commit -m "Sync changes from hyperweb-boilerplate for version ${{ steps.get_version.outputs.version }}"
85+
git commit -m "Sync changes from hyperweb-boilerplate for commit ${SHORT_HASH}"
8886
git push origin $NEW_BRANCH
8987
fi
9088

0 commit comments

Comments
 (0)