Skip to content

Conversation

@yashashkumar
Copy link

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.

- name: Test
run: npm run test
continue-on-error: true
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
continue-on-error: true

Copilot uses AI. Check for mistakes.
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package.json') }}

Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- name: Install dependencies
run: npm install --legacy-peer-deps

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +41
- name: Clone content plugins
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- 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' }}

Copilot uses AI. Check for mistakes.
Comment on lines 30 to +34
"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",
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"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",

Copilot uses AI. Check for mistakes.
`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`
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar error: 'you want fetch' should be 'you want to fetch'.

Suggested change
`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`

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants