-
Notifications
You must be signed in to change notification settings - Fork 1
fix(security): ci #103
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
base: main
Are you sure you want to change the base?
fix(security): ci #103
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,61 +4,61 @@ on: | |||||||
| workflow_dispatch: | ||||||||
| push: | ||||||||
| branches: [main] | ||||||||
| pull_request: | ||||||||
| pull_request_target: | ||||||||
| branches: [main] | ||||||||
| types: [reopened, synchronize, opened] | ||||||||
|
|
||||||||
| permissions: | ||||||||
| contents: read | ||||||||
|
|
||||||||
| jobs: | ||||||||
| requires-approval: | ||||||||
| runs-on: ubuntu-latest | ||||||||
| name: Waiting for PR approval as this workflow runs on pull_request_target | ||||||||
| if: github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.owner.login != 'cap-js' | ||||||||
| environment: pr-approval | ||||||||
| steps: | ||||||||
| - name: Approval Step | ||||||||
| run: echo "This job has been approved!" | ||||||||
|
|
||||||||
| test: | ||||||||
| name: Tests | ||||||||
| runs-on: ubuntu-latest | ||||||||
| needs: requires-approval | ||||||||
| if: always() && (needs.requires-approval.result == 'success' || needs.requires-approval.result == 'skipped') | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Logic Error: The condition The concern is the
Suggested change
Double-check suggestion before committing. Edit this comment for amendments. Please provide feedback on the review comment by checking the appropriate box:
|
||||||||
| strategy: | ||||||||
| fail-fast: false | ||||||||
| matrix: | ||||||||
| node-version: [20.x, 22.x] | ||||||||
| cds-version: [latest] | ||||||||
| steps: | ||||||||
| - name: Harden Runner | ||||||||
| uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 | ||||||||
| with: | ||||||||
| egress-policy: audit | ||||||||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||||||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||||||||
| with: | ||||||||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||||||||
|
Comment on lines
+7
to
37
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security: The workflow was changed from The Should either:
Please provide feedback on the review comment by checking the appropriate box:
|
||||||||
| - name: Use Node.js ${{ matrix.node-version }} | ||||||||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||||||||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | ||||||||
| with: | ||||||||
| node-version: ${{ matrix.node-version }} | ||||||||
| - run: npm i -g @sap/cds-dk@${{ matrix.cds-version }} | ||||||||
| - run: npm i | ||||||||
| - run: npm run build | ||||||||
| - run: cd tests/bookshop && npm run build | ||||||||
| - run: npm run test | ||||||||
|
|
||||||||
| hybrid-tests: | ||||||||
| runs-on: ubuntu-latest | ||||||||
| needs: requires-approval | ||||||||
| if: always() && (needs.requires-approval.result == 'success' || needs.requires-approval.result == 'skipped') | ||||||||
| name: Integration Tests | ||||||||
| # Requires approval via config | ||||||||
| environment: CI | ||||||||
| strategy: | ||||||||
| fail-fast: false | ||||||||
| matrix: | ||||||||
| node-version: [20.x, 22.x] | ||||||||
| cds-version: [latest] | ||||||||
| profile: [hana, hana-process] | ||||||||
| steps: | ||||||||
| - name: Harden Runner | ||||||||
| uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 | ||||||||
| with: | ||||||||
| egress-policy: audit | ||||||||
| - name: Checkout repository | ||||||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||||||
| with: | ||||||||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||||||||
| - name: Integration tests | ||||||||
| uses: ./.github/actions/integration-tests | ||||||||
| uses: cap-js/process/.github/actions/integration-tests@main | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security: Referencing a reusable action at a mutable
Should pin this to a specific commit SHA to ensure the action's code is immutable and auditable: uses: cap-js/process/.github/actions/integration-tests@<commit-sha>
Suggested change
Double-check suggestion before committing. Edit this comment for amendments. Please provide feedback on the review comment by checking the appropriate box:
|
||||||||
| with: | ||||||||
| CF_API: ${{ secrets.CF_API }} | ||||||||
| CF_USERNAME: ${{ secrets.CF_USERNAME }} | ||||||||
|
|
||||||||
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.
Bug:
matrix.cds-versionis referenced inside this composite action but thematrixcontext is not available in composite actionsThe composite action references
${{ matrix.cds-version }}in itsrunsteps (e.g. line 71, 75, 90, 96, 98, 135 of the full file). Thematrixcontext exists only in the calling workflow's job scope and is not passed into composite actions. At runtime this expression resolves to an empty string, meaning commands likenpm i -g @sap/cds-dk@will install the latest version regardless of the matrix value — producing inconsistent test results silently.Should add a
cds-versioninput to the composite action and pass${{ matrix.cds-version }}fromtest.ymlviawith:, then reference${{ inputs.cds-version }}throughout the action.Please provide feedback on the review comment by checking the appropriate box: