refactor: Content filter helper function #2255
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: ['main'] | |
pull_request: ~ | |
workflow_dispatch: ~ | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: ${{ fromJSON(vars.SUPPORTED_NODE_VERSIONS) }} | |
steps: | |
- uses: sap/ai-sdk-js/.github/actions/setup@main | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: pnpm test:unit | |
- run: pnpm test:type | |
- run: pnpm test:schema | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: sap/ai-sdk-js/.github/actions/setup@main | |
- name: REUSE Compliance Check | |
uses: fsfe/reuse-action@v5 | |
- run: pnpm generate | |
- name: Enforce generated code is up to date | |
run: | | |
if [[ -n "$(git status --porcelain)" ]]; then | |
echo "Generated code is out of date. The following changes were found after generating:" | |
git status | |
echo "Please run 'pnpm generate' and commit the changes." | |
exit 1 | |
fi | |
- run: pnpm lint | |
- name: Check CommonJS compatibility | |
run: pnpm compile:cjs | |
- name: Set NODE_PATH | |
run: echo "NODE_PATH=$(pwd)/node_modules" >> $GITHUB_ENV | |
- name: Check public API | |
uses: sap/cloud-sdk-js/.github/actions/check-public-api@main | |
with: | |
force_internal_exports: 'false' | |
ignored_path_pattern: '.*?/client/.*?/schema' | |
- name: Check dependencies | |
run: pnpm check:deps | |
- name: License Check | |
uses: sap/cloud-sdk-js/.github/actions/check-license@main | |
dependabot: | |
runs-on: ubuntu-latest | |
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }} | |
needs: [test, checks] | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/[email protected] | |
with: | |
github-token: '${{ secrets.GITHUB_TOKEN }}' | |
- name: Approve a PR | |
run: gh pr review --approve "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Enable auto-merge for Dependabot PRs | |
run: gh pr merge --auto --squash "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |