Skip to content

Commit

Permalink
UI refresh action cherrypick to 24-1 (#5174)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimir Lewandowski <[email protected]>
  • Loading branch information
antonkovalenko and vovaspace authored Jun 6, 2024
1 parent ea2ef69 commit ec1169f
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions .github/workflows/embedded_ui_refresh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,42 @@ jobs:
run: gh release download $TAG_NAME --repo $REPOSITORY --pattern $ASSET_NAME.zip --dir $TEMP_ASSET_DIR
- name: Asset Placement
env:
ASSET_DIR: monitoring
START_POINTER: "# GENERATED MONITORING RESOURCES START"
END_POINTER: "# GENERATED MONITORING RESOURCES END"
TARGET_DIR: ydb/core/viewer/monitoring
YA_MAKE_FILE: ydb/core/viewer/ya.make
WORKING_DIR: ydb/core/viewer
run: |
unzip $TEMP_ASSET_DIR/$ASSET_NAME.zip -d $TEMP_ASSET_DIR
rm -rf $TARGET_DIR
mkdir $TARGET_DIR
mv -vf $TEMP_ASSET_DIR/$ASSET_NAME/* $TARGET_DIR
set -e
unzip $TEMP_ASSET_DIR/$ASSET_NAME.zip -d $TEMP_ASSET_DIR
cd $WORKING_DIR
rm -rf $ASSET_DIR
mkdir $ASSET_DIR
mv -vf $TEMP_ASSET_DIR/$ASSET_NAME/* $ASSET_DIR
# List of files in the target directory.
NEW_RESOURCES=$(find $TARGET_DIR -type f | sort)
NEW_RESOURCES=$(find $ASSET_DIR -type f | sort)
# Current indentation of the start pointer line.
INDENTATION=$(grep -e "$START_POINTER" $YA_MAKE_FILE | perl -lane 's/^(\s+)(.*)+$/$1/e; print')
INDENTATION=$(grep -e "$START_POINTER" ya.make | perl -lane 's/^(\s+)(.*)+$/$1/e; print')
# Replacing resources list between start and end pointers with saving the current indentation.
perl -0777 -pi -e "s/\s+$START_POINTER.*$END_POINTER/
$INDENTATION$START_POINTER
${INDENTATION}RESOURCE(
$(echo "$NEW_RESOURCES" | perl -e "while (<>) {chomp; print \"$INDENTATION \$_ \$_\\n\";}" | sed -E 's/\//\\\//g')
$INDENTATION)
$INDENTATION$END_POINTER/s" $YA_MAKE_FILE
$INDENTATION$END_POINTER/s" ya.make
- name: Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
commit-message: "build: refresh Embedded UI (${{ env.TAG_NAME }})"
branch: embedded-ui-refresh-${{ env.TAG_NAME }}
branch: embedded-ui-${{ env.TAG_NAME }}
delete-branch: true
title: "build: refresh Embedded UI (${{ env.TAG_NAME }})"
body: |
### Embedded UI Refresh
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)).
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 comments on commit ec1169f

Please sign in to comment.