diff --git a/.github/workflows/stats_lambda.yml b/.github/workflows/stats_lambda.yml new file mode 100644 index 00000000000..830ea3ae3f5 --- /dev/null +++ b/.github/workflows/stats_lambda.yml @@ -0,0 +1,31 @@ +# This workflow executes a Lamdba function that recording metrics for each merged PR. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/marketplace/actions/invoke-aws-lambda + +name: Invoke runTheNumbers lambda functions +on: + pull_request: + types: + - closed + workflow_dispatch: +env: + COMMIT: ${{github.event.pull_request.head.sha}} +jobs: + if_merged: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: echo "JSON_PAYLOAD={\"commit\" :\"${{ env.COMMIT }}\"}" >> $GITHUB_ENV + - name: Invoke runTheNumbers + 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