You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to output ord document as static file and validate it in github action workflow:
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install dependencies and prepare documents
run: |
npm install -g @sap/cds-dk
npm install @sap/cds
npm install https://github.com/cap-js/ord#fix_undefined
cds compile ./ariba/srv --to ord -o ./tmp_documents/ariba.json
cds compile ./cloud/srv --to ord -o ./tmp_documents/cloud.json
cds compile ./erp/srv --to ord -o ./tmp_documents/erp.json
I create a debug branch and add two logger info, which prints out package name value.
The error shows:
packageName: undefined
[ord-plugin] - logger packageName undefined
TypeError: Cannot read properties of undefined (reading 'replace')
at initializeAppConfig (/opt/actions-runner/_work/oid-cap-reference-app/oid-cap-reference-app/node_modules/@cap-js/ord/lib/ord.js:26:38)
at module.exports (/opt/actions-runner/_work/oid-cap-reference-app/oid-cap-reference-app/node_modules/@cap-js/ord/lib/ord.js:151:23)
at /opt/actions-runner/_work/_tool/node/18.20.3/x64/lib/node_modules/@sap/cds-dk/bin/compile/index.js:315:36
at Generator.next (<anonymous>)
at _write (/opt/actions-runner/_work/_tool/node/18.20.3/x64/lib/node_modules/@sap/cds-dk/lib/util/write.js:65:[28](https://github.tools.sap/CPA/oid-cap-reference-app/actions/runs/8966939/job/36012553?pr=49#step:6:29))
at Object.to (/opt/actions-runner/_work/_tool/node/18.20.3/x64/lib/node_modules/@sap/cds-dk/lib/util/write.js:40:42)
at /opt/actions-runner/_work/_tool/node/18.20.3/x64/lib/node_modules/@sap/cds-dk/lib/util/write.js:53:49
at async Object.exec (/opt/actions-runner/_work/_tool/node/18.20.3/x64/lib/node_modules/@sap/cds-dk/bin/cds.js:91:16)
Error: Process completed with exit code 1.
Diagnose:
I think the problem is how do we define the packageJsonPath. The current implementation is:
which we use cds.root as base path. However, when we want to use cds command line to output ord static file, the cds command could be executed in anywhere.
Propose:
We need to stick to the path where srv folder is.
The text was updated successfully, but these errors were encountered:
zongqichen
changed the title
Fix: packageName is undefined on github action
Fix: cds command executed outside the root of application cause undefined error
Oct 30, 2024
I want to output ord document as static file and validate it in github action workflow:
I create a debug branch and add two logger info, which prints out package name value.
The error shows:
Diagnose:
I think the problem is how do we define the
packageJsonPath
. The current implementation is:which we use
cds.root
as base path. However, when we want to use cds command line to output ord static file, thecds
command could be executed in anywhere.Propose:
We need to stick to the path where srv folder is.
The text was updated successfully, but these errors were encountered: