[RED-2503][RED-2506][RED-2507][RED-2509] Add zaf_sdk user agent to headers for requests #228
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: main | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
dependency-guard: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: zendesk/checkout@v2 | |
- name: Block dependencies from being added to package.json | |
run: | | |
IFS=' ' read -r allowed <<< "native-promise-only zendesk_app_framework_sdk" | |
dependencies=$(jq -r .dependencies package.json | jq 'keys' | jq .[] | sed 's/"//g') | |
for dep in "${dependencies[@]}"; do | |
if [[ ! ${allowed[*]} =~ (^|[[:space:]])"$dep"($|[[:space:]]) ]]; then | |
echo "::error ZAP SDK does not allow external dependencies, please remove \"${dep}\" dependency from package.json" | |
exit 1 | |
fi | |
done | |
shell: bash | |
main-job: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- env: | |
TASK: lint | |
command: npm run lint | |
- env: | |
TASK: test | |
command: npm test | |
- env: | |
TASK: build | |
command: npm run build | |
steps: | |
- uses: zendesk/checkout@v2 | |
- uses: zendesk/[email protected] | |
with: | |
node-version: 12.10.0 | |
- name: install npm modules | |
run: | | |
npm install standardx | |
- name: ${{ matrix.env.TASK }} | |
run: TASK=${{ matrix.env.TASK }} ${{ matrix.command }} |