diff --git a/.github/workflows/enforce-version-pinning.yml b/.github/workflows/enforce-version-pinning.yml new file mode 100644 index 000000000..e0d6d0a78 --- /dev/null +++ b/.github/workflows/enforce-version-pinning.yml @@ -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 diff --git a/package.json b/package.json index 62f8f36a6..68d64db1b 100644 --- a/package.json +++ b/package.json @@ -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",