Skip to content

Certificate error while sending email #238

@meenuramesh

Description

@meenuramesh

We are getting "unable to get local issuer certificate" error when trying to send email.

on:
push:
branches:

  • main

jobs:
job1:
runs-on: [self-hosted, linux, x64]
steps:

  • name: Get LOC
    env:
    Token: ${{ secrets. }}
    run: |
    LOC_consumed=curl -s -u $Token: -k | jq '.' | grep 'Lines of Code' | awk '{print $4}' | sed 's/,//g' | sed 's/"//g'
    echo "LOC Consumed: " $LOC_consumed
  • name: Decode and Install SMTP Certificate
    run: |
    echo "${{ secrets. }}" | base64 --decode > smtp-cert.crt
  • name: Send email
    uses: dawidd6/action-send-mail@v3
    env:
    NODE_EXTRA_CA_CERTS: /etc/pki/ca-trust/source/anchors/smtp-cert.crt
    with:
    server_address:
    server_port: 25,
    secure: false
    subject: LOC report
    body: "LOC Consumed: ${{ steps.get_loc.outputs.loc }}"
    to: [](mailto:)
    from: noreply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions