Skip to content

Using a GitHub env variable for the To: field #214

Open
@peluse

Description

I submitted this before as it didn't work, I saw your comment. My goal was to email specific attachments to the Author when the job fails (not all the logs just things I want to send).

FYI I was able to make it work by doing this:

YAML:
echo "USER_EMAIL=$(git log -1 HEAD | grep -m 1 -E -o '[[:alnum:].-]+@[[:alnum:].-]+.[[:alnum:]]{2,}')" >> $GITHUB_ENV

Change I make in your code:

from:
const to = core.getInput("to", { required: true })
to:
const to = process.env.USER_EMAIL

as getInput() simply wouldn't access the env. Seems like it only works with built-in vars like secrets. Anyway, not sure how valid this hack is but wanted to share. Feel free to close :)

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