mirror of https://github.com/CGAL/cgal
create a reusable workflow that send email
This commit is contained in:
parent
5604425c5e
commit
10d1521bc6
|
|
@ -0,0 +1,31 @@
|
||||||
|
name: Send Email
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
message:
|
||||||
|
description: 'Message to send'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
email:
|
||||||
|
description: 'Email address to send to'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
private_key:
|
||||||
|
required: true
|
||||||
|
user:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
send_email:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: install ssh keys
|
||||||
|
run: |
|
||||||
|
install -m 600 -D /dev/null ~/.ssh/id_rsa
|
||||||
|
echo "${{ secrets.private_key }}" > ~/.ssh/id_rsa
|
||||||
|
ssh-keyscan -H ${{ vars.CGAL_SEND_EMAIL_SSH_HOST }} > ~/.ssh/known_hosts
|
||||||
|
- name: send email via ssh
|
||||||
|
run: |
|
||||||
|
echo "${{ inputs.message }}" | ssh ${{ secrets.user }}@${{ vars.CGAL_SEND_EMAIL_SSH_HOST }} "/sbin/sendmail -t ${{ inputs.email }}"
|
||||||
Loading…
Reference in New Issue