Skip to content

update stats-lambda.yml (GH-action) #3

update stats-lambda.yml (GH-action)

update stats-lambda.yml (GH-action) #3

Workflow file for this run

# This workflow executes a Lamdba function that records metrics for each successfully merged PR.
#
# For more information, see:
# https://github.com/marketplace/actions/invoke-aws-lambda
name: Trigger Lambda to capture metrics
on: # yamllint disable-line rule:truthy
pull_request:
types:
- closed
workflow_dispatch:
env:
COMMIT: ${{github.event.pull_request.head.sha}}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
name: GitHub Statistics
steps:
- name: Create payload
run: echo "JSON_PAYLOAD={\"commit\" :\"${{ env.COMMIT }}\",\"author\" :\"${{ env.PR_AUTHOR }}\"}" >> $GITHUB_ENV
- name: Invoke Lambda
uses: gagoar/invoke-aws-lambda@master
with:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
REGION: 'eu-west-1'
FunctionName: runTheNumbers
Payload: ${{env.JSON_PAYLOAD}}
InvocationType: RequestResponse
LogType: None