diff --git a/.github/actions/integration-tests/action.yml b/.github/actions/integration-tests/action.yml index c1bf99d6..129df585 100644 --- a/.github/actions/integration-tests/action.yml +++ b/.github/actions/integration-tests/action.yml @@ -58,11 +58,11 @@ runs: fi done - - uses: actions/checkout@v5 + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Use Node.js ${{ inputs.NODE_VERSION }} - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: ${{ inputs.NODE_VERSION }} diff --git a/.github/workflows/check-changelog.yml b/.github/workflows/check-changelog.yml index 795a3f63..0e6c4b78 100644 --- a/.github/workflows/check-changelog.yml +++ b/.github/workflows/check-changelog.yml @@ -13,10 +13,6 @@ jobs: name: Check Changelog Action runs-on: ubuntu-latest steps: - - name: Harden Runner - uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 - with: - egress-policy: audit - uses: tarides/changelog-check-action@0189fc7eedec3ef3e9648c713908f6f2a6e99057 # v3 with: changelog: CHANGELOG.md diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml index 417d0496..d478492c 100644 --- a/.github/workflows/issue.yml +++ b/.github/workflows/issue.yml @@ -12,10 +12,6 @@ jobs: label_issues: runs-on: ubuntu-latest steps: - - name: Harden Runner - uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 - with: - egress-policy: audit - run: gh issue edit "$NUMBER" --add-label "$LABELS" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -23,7 +19,7 @@ jobs: NUMBER: ${{ github.event.issue.number }} LABELS: New - - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 with: script: | github.rest.issues.createComment({ diff --git a/.github/workflows/lint-prettier.yml b/.github/workflows/lint-prettier.yml index 34e79827..a6492247 100644 --- a/.github/workflows/lint-prettier.yml +++ b/.github/workflows/lint-prettier.yml @@ -17,10 +17,6 @@ jobs: lint: runs-on: ubuntu-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/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - run: npm i diff --git a/.github/workflows/prevent-issue-labeling.yml b/.github/workflows/prevent-issue-labeling.yml index ce87fc3a..dac7a41b 100644 --- a/.github/workflows/prevent-issue-labeling.yml +++ b/.github/workflows/prevent-issue-labeling.yml @@ -11,10 +11,6 @@ jobs: remove_new_label: runs-on: ubuntu-latest steps: - - name: Harden Runner - uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 - with: - egress-policy: audit - name: Remove "New" label if applied by non-bot user if: > contains(github.event.issue.labels.*.name, 'New') && diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7de07d24..282c04e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,9 @@ jobs: node-version: [20.x, 22.x] cds-version: [latest] steps: - - uses: actions/checkout@v6.0.2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v6 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version: ${{ matrix.node-version }} - run: npm i -g @sap/cds-dk@${{ matrix.cds-version }} @@ -31,10 +31,6 @@ jobs: runs-on: ubuntu-latest environment: npm 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/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: @@ -45,7 +41,7 @@ jobs: - run: npm run build - name: get-version id: package-version - uses: martinbeentjes/npm-get-version-action@v1.3.1 + uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1 - name: Parse changelog id: parse-changelog uses: schwma/parse-changelog-action@1c2b2005ccf594cc3a45d33c10af4ab924d3a1c5 # v1.2.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9258d022..36fdd95a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: [main] - pull_request: + pull_request_target: branches: [main] types: [reopened, synchronize, opened] @@ -12,24 +12,31 @@ 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') 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 }} - 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 }} @@ -37,11 +44,12 @@ jobs: - 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: @@ -49,16 +57,8 @@ jobs: 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 with: CF_API: ${{ secrets.CF_API }} CF_USERNAME: ${{ secrets.CF_USERNAME }}