Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/conductor-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to modules-conductor

on:
push:
branches:
- conductor-migration

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v6
with:
submodules: recursive

- name: Enable Corepack
run: corepack enable

- name: Use Node.js 💻
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: yarn

- name: Install Dependencies 📦
run: yarn install --immutable

- name: Build Modules 🔧
run: yarn workspaces foreach -ptW --from "./src/{bundles,tabs}/*" run build

- name: Build Manifest
run: yarn buildtools manifest

- name: Build All Docs
run: yarn build:docs

- name: include java json
run: cp -r src/java build
Comment on lines +38 to +39
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The cp -r src/java build command will cause the workflow to fail if the src/java directory does not exist, as there is no error handling.
Severity: HIGH

Suggested Fix

Wrap the cp command in a conditional check to ensure it only runs if the src/java directory exists. For example: if [ -d src/java ]; then cp -r src/java build; fi. This prevents the step from failing if the directory is absent.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/workflows/conductor-deploy.yml#L38-L39

Potential issue: The `conductor-deploy.yml` workflow includes the command `cp -r
src/java build`. This command will fail with a non-zero exit code if the `src/java`
directory does not exist on the branch where the workflow is triggered. Since GitHub
Actions treats non-zero exit codes as step failures by default and there is no
conditional check or `continue-on-error` flag, the entire deployment workflow will halt
and fail. The `src/java` directory does not currently exist in the repository's main
branch, making this failure a realistic scenario.

Did we get this right? 👍 / 👎 to inform future reviews.


- name: Deploy 🚀
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.CONDUCTOR_DEPLOY_KEY }}
external_repository: source-academy/modules-conductor
publish_dir: ./build

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +10 to +46
Loading