Coss 5.2.1 actions#88
Conversation
…Linting steps also added in the workflow.
Github action to build and push to blob
There was a problem hiding this comment.
Pull Request Overview
This PR adds GitHub Actions CI/CD workflows and updates the project's ESLint configuration. The changes introduce automated build, test, and deployment processes triggered by pull requests and tag pushes.
- Adds GitHub Actions workflows for pull request validation and automated publishing
- Updates ESLint from version 5.6.0 to 8.57.1 with additional configuration packages
- Migrates ESLint configuration from JSON format to JavaScript module format
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates ESLint version and adds new linting dependencies plus lint script |
| README.md | Adds comprehensive documentation for GitHub Actions workflows |
| .github/workflows/pull-request.yml | Implements PR validation workflow with build, test, and lint checks |
| .github/workflows/publish.yml | Implements automated publishing workflow for multiple cloud providers |
| .eslintrc.js | Creates new JavaScript-based ESLint configuration with warning-only plugin |
| .eslintrc | Removes old JSON-based ESLint configuration file |
|
|
||
| - name: Clone plugins (from fork) | ||
| run: | | ||
| git clone --branch ${{ env.CONTENT_PLUGIN_VERSION }} https://github.com/vinodbhorge/sunbird-content-plugins.git plugins |
There was a problem hiding this comment.
The workflow clones from a personal fork (vinodbhorge/sunbird-content-plugins) instead of the official repository. This introduces a security risk as the personal fork could contain malicious code.
| git clone --branch ${{ env.CONTENT_PLUGIN_VERSION }} https://github.com/vinodbhorge/sunbird-content-plugins.git plugins | |
| git clone --branch ${{ env.CONTENT_PLUGIN_VERSION }} https://github.com/Sunbird-Ed/sunbird-content-plugins.git plugins |
|
|
||
| - name: Test | ||
| run: npm run test | ||
| continue-on-error: true |
There was a problem hiding this comment.
Tests are allowed to fail without stopping the workflow. This defeats the purpose of running tests in CI/CD and could allow broken code to pass validation.
| continue-on-error: true |
| with: | ||
| path: node_modules | ||
| key: ${{ runner.os }}-node-${{ hashFiles('package.json') }} | ||
|
|
There was a problem hiding this comment.
The lint job depends on build-test but doesn't install dependencies. The cached node_modules from the build-test job won't be available since jobs run in separate environments.
| - name: Install dependencies | |
| run: npm install --legacy-peer-deps |
|
|
||
| - name: Clone content plugins |
There was a problem hiding this comment.
The workflow assumes that every tag pushed to this repository has a corresponding branch with the same name in the sunbird-content-plugins repository, which may not always be true and could cause the workflow to fail.
| - name: Clone content plugins | |
| - name: Check if branch exists in sunbird-content-plugins | |
| run: | | |
| if git ls-remote --heads https://github.com/Sunbird-Knowlg/sunbird-content-plugins.git ${{ github.ref_name }} | grep -q ${{ github.ref_name }}; then | |
| echo "Branch ${{ github.ref_name }} exists in sunbird-content-plugins." | |
| echo "true" > branch_exists.txt | |
| else | |
| echo "Branch ${{ github.ref_name }} does not exist in sunbird-content-plugins." | |
| echo "false" > branch_exists.txt | |
| fi | |
| - name: Clone content plugins | |
| if: ${{ steps.check-branch.outputs.branch_exists == 'true' }} |
| "eslint-plugin-import": "^2.14.0", | ||
| "eslint-plugin-node": "^7.0.1", | ||
| "eslint-plugin-promise": "^4.0.1", | ||
| "eslint-plugin-standard": "^4.0.0", | ||
| "eslint-config-standard": "^12.0.0", |
There was a problem hiding this comment.
Upgrading ESLint from version 5.6.0 to 8.57.1 is a major version jump that may introduce breaking changes. Consider testing thoroughly to ensure existing code still passes linting with the new version.
| "eslint-plugin-import": "^2.14.0", | |
| "eslint-plugin-node": "^7.0.1", | |
| "eslint-plugin-promise": "^4.0.1", | |
| "eslint-plugin-standard": "^4.0.0", | |
| "eslint-config-standard": "^12.0.0", | |
| "eslint-plugin-import": "^2.27.5", | |
| "eslint-plugin-node": "^11.1.0", | |
| "eslint-plugin-promise": "^6.1.1", | |
| "eslint-plugin-standard": "^5.0.0", | |
| "eslint-config-standard": "^17.0.0", |
| `SONAR_TOKEN`: For SonarQube authentication | ||
|
|
||
| ### Repository Variables | ||
| `CONTENT_PLUGIN_VERSION`: Have to specify the branch or tag you want fetch. By default it will take `release-8.0.0` |
There was a problem hiding this comment.
Grammar error: 'you want fetch' should be 'you want to fetch'.
| `CONTENT_PLUGIN_VERSION`: Have to specify the branch or tag you want fetch. By default it will take `release-8.0.0` | |
| `CONTENT_PLUGIN_VERSION`: Have to specify the branch or tag you want to fetch. By default it will take `release-8.0.0` |
No description provided.