You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the 'main' branch and directory 'bi-main' assumes the default branch name is 'main', which may change. Consider parameterizing the branch or deriving it dynamically to prevent future breaks.
curl -L -u "${{ secrets.SEMOSS_GITHUB_USERNAME }}:${{ secrets.SEMOSS_GITHUB_PAT }}" -o tmp/main.zip https://github.com/SEMOSS/bi/archive/refs/heads/main.zipecho "Unzip contents of the SEMOSS/bi to the tmp folder"unzip tmp/main.zip -d tmp/echo "Delete the playsheet folder from semoss/bi files"rm -rf tmp/bi-main/playsheet/ls -als tmp/bi-main/
The run blocks do not include 'set -e' or explicit exit checks, so failures in commands (e.g., unzip, rm) may not abort the workflow. Add strict error handling to ensure CI fails fast on errors.
- name: Delete contents of legacy folderrun: | echo "Remove and recreate the legacy folder" rm -rf legacy mkdir legacy ls -als
- name: Download contents of SEMOSS/bi projectrun: | echo "Download SEMOSS/bi as a zip file" mkdir -p tmp curl -L -u "${{ secrets.SEMOSS_GITHUB_USERNAME }}:${{ secrets.SEMOSS_GITHUB_PAT }}" -o tmp/main.zip https://github.com/SEMOSS/bi/archive/refs/heads/main.zip echo "Unzip contents of the SEMOSS/bi to the tmp folder" unzip tmp/main.zip -d tmp/ echo "Delete the playsheet folder from semoss/bi files" rm -rf tmp/bi-main/playsheet/ ls -als tmp/bi-main/ echo "Remove zip file" rm tmp/main.zip
- name: Move SEMOSS/bi files into the legacy folderrun: | echo "Move contents of SEMOSS/bi into legacy folder" cp -r tmp/bi-main/. legacy/ echo "Delete tmp folder" rm -rf tmp/ echo "list files under legacy folder" ls -als legacy
The 'ls -als' commands throughout the steps produce verbose output that could clutter CI logs. Remove or limit these listings to only necessary debug steps.
ls -als
- name: Download contents of SEMOSS/bi projectrun: | echo "Download SEMOSS/bi as a zip file" mkdir -p tmp curl -L -u "${{ secrets.SEMOSS_GITHUB_USERNAME }}:${{ secrets.SEMOSS_GITHUB_PAT }}" -o tmp/main.zip https://github.com/SEMOSS/bi/archive/refs/heads/main.zip echo "Unzip contents of the SEMOSS/bi to the tmp folder" unzip tmp/main.zip -d tmp/ echo "Delete the playsheet folder from semoss/bi files" rm -rf tmp/bi-main/playsheet/ ls -als tmp/bi-main/ echo "Remove zip file" rm tmp/main.zip
- name: Move SEMOSS/bi files into the legacy folderrun: | echo "Move contents of SEMOSS/bi into legacy folder" cp -r tmp/bi-main/. legacy/ echo "Delete tmp folder" rm -rf tmp/ echo "list files under legacy folder" ls -als legacy
Ensure the script fails immediately on any error and prevents unset variables by adding strict shell options at the start of the run block. Also use mkdir -p for idempotent directory creation.
run: |
+ set -euo pipefail
echo "Remove and recreate the legacy folder"
rm -rf legacy
- mkdir legacy+ mkdir -p legacy
ls -als
Suggestion importance[1-10]: 7
__
Why: Adding set -euo pipefail and switching to mkdir -p improves error handling and idempotence in the legacy folder cleanup.
Medium
Enable curl error handling
Fail the download step on HTTP errors and suppress sensitive output by adding --fail -sS flags to curl. This ensures the workflow stops if the ZIP cannot be retrieved.
Why: Including --fail -sS ensures the workflow stops on HTTP errors and hides sensitive output, enhancing reliability.
Medium
General
Use checkout action for repo
Replace the manual curl and unzip steps with the built-in actions/checkout for SEMOSS/bi to simplify authentication and fetching. This reduces custom scripting and leverages native GitHub Actions support.
Why: Leveraging actions/checkout simplifies the download logic, reduces custom scripting, and uses native GitHub Actions support.
Medium
Exclude .git metadata when copying
Avoid copying unwanted Git metadata and hidden files by using rsync with an exclude pattern. This keeps the legacy folder clean and only includes necessary files.
Updated CI to remove legacy folder and import SEMOSS/bi files
Replaced obsolete legacy content with upstream SEMOSS/bi project files
to commit the new content to the CHANGELOG.md file, please type:
'/update_changelog --pr_update_changelog.push_changelog_changes=true'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change will delete the files in the legacy folder and replace them with files from the SEMOSS/bi project
Changes Made
How to Test
Notes
N/A