Skip to content

Commit 1fa5b08

Browse files
authored
ci: fix Embedded UI Refresh workflow (#1514)
* ci: fix Embedded UI asset placement * ci: fix body formatting of Embedded UI Refresh PR
1 parent a677875 commit 1fa5b08

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.github/workflows/embedded_ui_refresh.yaml

+16-14
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,33 @@ jobs:
3636
run: gh release download $TAG_NAME --repo $REPOSITORY --pattern $ASSET_NAME.zip --dir $TEMP_ASSET_DIR
3737
- name: Asset Placement
3838
env:
39+
ASSET_DIR: monitoring
3940
START_POINTER: "# GENERATED MONITORING RESOURCES START"
4041
END_POINTER: "# GENERATED MONITORING RESOURCES END"
41-
TARGET_DIR: ydb/core/viewer/monitoring
42-
YA_MAKE_FILE: ydb/core/viewer/ya.make
42+
WORKING_DIR: ydb/core/viewer
4343
run: |
44-
unzip $TEMP_ASSET_DIR/$ASSET_NAME.zip -d $TEMP_ASSET_DIR
45-
rm -rf $TARGET_DIR
46-
mkdir $TARGET_DIR
47-
mv -vf $TEMP_ASSET_DIR/$ASSET_NAME/* $TARGET_DIR
44+
set -e
4845
46+
unzip $TEMP_ASSET_DIR/$ASSET_NAME.zip -d $TEMP_ASSET_DIR
47+
48+
cd $WORKING_DIR
49+
rm -rf $ASSET_DIR
50+
mkdir $ASSET_DIR
51+
mv -vf $TEMP_ASSET_DIR/$ASSET_NAME/* $ASSET_DIR
52+
4953
# List of files in the target directory.
50-
NEW_RESOURCES=$(find $TARGET_DIR -type f | sort)
51-
54+
NEW_RESOURCES=$(find $ASSET_DIR -type f | sort)
55+
5256
# Current indentation of the start pointer line.
53-
INDENTATION=$(grep -e "$START_POINTER" $YA_MAKE_FILE | perl -lane 's/^(\s+)(.*)+$/$1/e; print')
54-
57+
INDENTATION=$(grep -e "$START_POINTER" ya.make | perl -lane 's/^(\s+)(.*)+$/$1/e; print')
58+
5559
# Replacing resources list between start and end pointers with saving the current indentation.
5660
perl -0777 -pi -e "s/\s+$START_POINTER.*$END_POINTER/
5761
$INDENTATION$START_POINTER
5862
${INDENTATION}RESOURCE(
5963
$(echo "$NEW_RESOURCES" | perl -e "while (<>) {chomp; print \"$INDENTATION \$_ \$_\\n\";}" | sed -E 's/\//\\\//g')
6064
$INDENTATION)
61-
$INDENTATION$END_POINTER/s" $YA_MAKE_FILE
65+
$INDENTATION$END_POINTER/s" ya.make
6266
- name: Pull Request
6367
uses: peter-evans/create-pull-request@v5
6468
with:
@@ -70,6 +74,4 @@ jobs:
7074
body: |
7175
### Embedded UI Refresh
7276
73-
Embedded UI
74-
[${{ env.TAG_NAME }}](https://github.com/${{ env.REPOSITORY }}/releases/tag/${{ env.TAG_NAME }})
75-
([CHANGELOG.md](https://github.com/${{ env.REPOSITORY }}/blob/${{ env.TAG_NAME }}/CHANGELOG.md)).
77+
Embedded UI [${{ env.TAG_NAME }}](https://github.com/${{ env.REPOSITORY }}/releases/tag/${{ env.TAG_NAME }}) ([CHANGELOG.md](https://github.com/${{ env.REPOSITORY }}/blob/${{ env.TAG_NAME }}/CHANGELOG.md)).

0 commit comments

Comments
 (0)