Skip to content

added GetMethodResponseHandler in IntentReader.js #2

added GetMethodResponseHandler in IntentReader.js

added GetMethodResponseHandler in IntentReader.js #2

name: Validate unit-tests and build FCA
on:
pull_request:
branches:
- dev
- main
push:
branches:
- dev
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set Run Variables
run: |
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
if [[ "${{ github.base_ref }}" == 'dev' ]]; then
echo "MEND_PROJECT=os-dev-prs" >> $GITHUB_ENV
elif [[ "${{ github.base_ref }}" == 'main' ]]; then
echo "MEND_PROJECT=os-prod-prs" >> $GITHUB_ENV
fi
elif [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
echo "MEND_PROJECT=os-prod" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == 'refs/heads/dev' ]]; then
echo "MEND_PROJECT=os-edge" >> $GITHUB_ENV
fi
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run testCoverage
- name: Build
run: npm run build
- name: Run Whitesource/Mend scan
run: |
curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar
java -jar wss-unified-agent.jar -apiKey ${{ secrets.MEND_API_KEY }} -product FireboltCertificationApp -project $MEND_PROJECT -resolveAllDependencies false -npm_resolveDependencies true
- name: Set failure comment if failed for prs
if: ${{ failure() && github.event_name == 'pull_request' }}
run: echo "comment=Unit tests or build failed!" >> $GITHUB_ENV
- name: Set success comment
run: echo "comment=Unit tests and build succeeded!" >> $GITHUB_ENV
- name: Comment on PR
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
echo "${{ env.comment }}"
curl -X POST \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-d '{"body": "${{ env.comment }}"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
fi