-
Notifications
You must be signed in to change notification settings - Fork 1
Add CI workflow for linting, testing, and building #7
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
Conversation
This workflow runs on pushes and pull requests to the main branch, as well as on a daily schedule. It includes steps for checking out the code, setting up Node.js, installing dependencies, running linting and tests, building the project, and notifying Slack.
There was a problem hiding this 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 a new GitHub Actions CI workflow that automates linting, testing, building, and Slack notifications for the project. The workflow triggers on pushes/PRs to main and release branches, as well as on a daily schedule at 02:00 UTC.
- Configures automated CI pipeline with lint, test, and build steps
- Sets up Node.js 18 environment with npm caching
- Implements Slack notification on workflow completion or failure
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Notify Slack (always runs) | ||
| if: always() | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| HOSTINGER_SITE_URL: ${{ secrets.HOSTINGER_SITE_URL }} | ||
| WP_PUSHER_REPO: ${{ secrets.WP_PUSHER_REPO }} | ||
| WP_PUSHER_DEPLOY_TYPE: ${{ secrets.WP_PUSHER_DEPLOY_TYPE }} | ||
| JOB_STATUS: ${{ job.status }} | ||
| REPO: ${{ github.repository }} | ||
| BRANCH: ${{ github.ref_name }} | ||
| RUN_ID: ${{ github.run_id }} | ||
| RUN_NUMBER: ${{ github.run_number }} | ||
| ACTOR: ${{ github.actor }} | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| run: | | ||
| node scripts/slack-alert.js |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Slack notification step will run even if the slack-alert.js script doesn't exist or if SLACK_WEBHOOK_URL is not set, potentially masking failures. Add a conditional check to verify the webhook URL exists before attempting to run the notification script: if: always() && env.SLACK_WEBHOOK_URL != ''
| - name: Run tests | ||
| run: npm test | ||
|
|
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The npm test script is not defined in package.json. This will cause the workflow to fail. Add a "test" script to the "scripts" section of package.json, or remove this step if testing is not required.
| - name: Run tests | |
| run: npm test |
| - name: Build | ||
| run: npm run build | ||
|
|
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The npm run build script is not defined in package.json. This will cause the workflow to fail. Add a "build" script to the "scripts" section of package.json, or remove this step if building is not required.
| - name: Build | |
| run: npm run build |
| ACTOR: ${{ github.actor }} | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| run: | | ||
| node scripts/slack-alert.js |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scripts/slack-alert.js file does not exist in the repository. This step will fail when executed. Create the slack-alert.js script in a scripts/ directory or update the path to point to an existing script.
Co-authored-by: Copilot <[email protected]>
This workflow runs on pushes and pull requests to the main branch, as well as on a daily schedule. It includes steps for checking out the code, setting up Node.js, installing dependencies, running linting and tests, building the project, and notifying Slack.