Skip to content

Commit

Permalink
πŸ“Œ Add Version Pinning Checks (#1229)
Browse files Browse the repository at this point in the history
* πŸ§‘β€πŸ’» Add Version Pinning Checks

* πŸ“Œ Pin package.json
  • Loading branch information
Gary-H9 authored Jan 8, 2024
1 parent a5f83fa commit e9b74be
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 19 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/enforce-version-pinning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---

name: Enforce Version Pinning

on:
pull_request:
branches: [main]

jobs:
check-version-pinning:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check for pinned versions in requirements.txt
run: |
if grep -q -v '==' requirements.txt; then
echo "Unpinned dependencies found in requirements.txt"
echo "❌ Unpinned dependencies found in requirements.txt"
exit 1
else
echo "βœ… All dependencies are correctly pinned."
fi
- name: Check for pinned versions in package.json
run: |
UNPINNED=$(grep -E '"[^"]+": "\^|~' package.json || true)
if [ -n "$UNPINNED" ]; then
echo "❌ Unpinned dependencies found in package.json:"
echo "$UNPINNED"
exit 1
else
echo "βœ… All dependencies are correctly pinned."
fi
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
"repository": "https://github.com/ministryofjustice/analytics-platform-control-panel.git",
"license": "MIT",
"dependencies": {
"@ministryofjustice/frontend": "^0.0.17-alpha",
"accessible-autocomplete": "^2.0.4",
"core-js": "^3.26.1",
"govuk-frontend": "^3.0.0",
"html5shiv": "^3.7.3",
"jquery": "^3.6.1",
"jquery-ui": "^1.13.2",
"sass": "^1.56.1"
"@ministryofjustice/frontend": "0.0.17-alpha",
"accessible-autocomplete": "2.0.4",
"core-js": "3.26.1",
"govuk-frontend": "3.0.0",
"html5shiv": "3.7.3",
"jquery": "3.6.1",
"jquery-ui": "1.13.2",
"sass": "1.56.1"
},
"devDependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.20.5",
"@babel/plugin-transform-regenerator": "^7.20.5",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@testing-library/jest-dom": "^5.16.5",
"babel-jest": "^29.3.1",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"jsdom-simulant": "^1.1.2",
"npm-run-all": "^4.1.5"
"@babel/cli": "7.19.3",
"@babel/core": "7.20.5",
"@babel/plugin-transform-regenerator": "7.20.5",
"@babel/plugin-transform-runtime": "7.19.6",
"@babel/preset-env": "7.20.2",
"@testing-library/jest-dom": "5.16.5",
"babel-jest": "29.3.1",
"jest": "29.3.1",
"jest-environment-jsdom": "29.3.1",
"jsdom-simulant": "1.1.2",
"npm-run-all": "4.1.5"
},
"scripts": {
"css": "sass --load-path=node_modules/ --style=compressed controlpanel/frontend/static/app.scss:static/app.css",
Expand Down

0 comments on commit e9b74be

Please sign in to comment.