Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.16] Bumping version from 5.16.5 to 5.16.6 #8669

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/Validate-package-lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Validate package-lock.json Tests
on: [push, pull_request]

jobs:
run-package-lock-validation:
runs-on: ubuntu-latest
timeout-minutes: 90
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 22

- name: Backup the current package-lock.json
run: |
# Backup the current package-lock.json
mv package-lock.json package-lock-backup.json

# Generate a new package-lock.json
npm install

- name: Validate top-level versions in package-lock.json
run: |
# Validate the main version field
top_version_backup=$(jq -r '.version' package-lock-backup.json)
top_version_new=$(jq -r '.version' package-lock.json)

# Define the ANSI escape code for red
RED='\033[0;31m'
NC='\033[0m' # No Color (resets the color)

if [ "$top_version_backup" != "$top_version_new" ]; then
echo "The top-level version in package-lock.json is inconsistent."
echo -e "${RED}Original version: $top_version_backup${NC}"
echo -e "${RED}Generated version: $top_version_new${NC}"
exit 1
fi

- name: Validate dependencies top-level versions in package-lock.json
run: |
# Extract and validate top-level module versions
jq '.packages[""].dependencies' package-lock-backup.json > top-level-versions-backup.json
jq '.packages[""].dependencies' package-lock.json > top-level-versions-new.json

if ! diff -q top-level-versions-backup.json top-level-versions-new.json > /dev/null; then
echo -e "${RED}Top-level module versions in package-lock.json are inconsistent.${NC}"
echo -e "${RED}Differences:${NC}"
diff top-level-versions-backup.json top-level-versions-new.json || true
exit 1
else
echo "Top-level module versions are consistent. Validation passed."
fi

- name: Validate devDependencies top-level versions in package-lock.json
run: |
# Extract and validate top-level module versions
jq '.packages[""].devDependencies' package-lock-backup.json > top-level-versions-backup.json
jq '.packages[""].devDependencies' package-lock.json > top-level-versions-new.json


# Define the ANSI escape code for red
RED='\033[0;31m'
NC='\033[0m' # No Color (resets the color)

if ! diff -q top-level-versions-backup.json top-level-versions-new.json > /dev/null; then
echo -e "${RED}Top-level module versions in package-lock.json are inconsistent.${NC}"
echo -e "${RED}Differences:${NC}"
diff top-level-versions-backup.json top-level-versions-new.json || true
exit 1
else
echo "Top-level module versions are consistent. Validation passed."
fi

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "noobaa-core",
"version": "5.16.5",
"version": "5.16.6",
"license": "SEE LICENSE IN LICENSE",
"description": "",
"homepage": "https://github.com/noobaa/noobaa-core",
Expand Down
Loading