mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2025-07-22 23:03:28 +07:00
CI updates + devcontainer
This commit is contained in:
4
.devcontainer/Containerfile
Normal file
4
.devcontainer/Containerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM docker.io/library/ubuntu:latest
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install -y shellcheck shfmt jq npm git
|
18
.devcontainer/devcontainer.json
Normal file
18
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
|
||||||
|
{
|
||||||
|
"name": "devcontainer",
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "Containerfile"
|
||||||
|
},
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"GitHub.vscode-github-actions",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"mads-hartmann.bash-ide-vscode",
|
||||||
|
"ms-azuretools.vscode-containers"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@ -22,3 +22,7 @@ updates:
|
|||||||
pull-request-branch-name:
|
pull-request-branch-name:
|
||||||
separator: "-"
|
separator: "-"
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
- package-ecosystem: "devcontainers"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
84
.github/workflows/test.yml
vendored
84
.github/workflows/test.yml
vendored
@ -11,66 +11,44 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
mailpit:
|
||||||
|
image: docker.io/axllent/mailpit:latest
|
||||||
|
ports:
|
||||||
|
- 1025:1025
|
||||||
|
- 8025:8025
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 1
|
max-parallel: 1
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- subject: Plain body (attachment)
|
|
||||||
attachments: action.yml
|
|
||||||
body: |
|
|
||||||
first line
|
|
||||||
second line
|
|
||||||
- subject: HTML body (attachments)
|
|
||||||
attachments: package.json,package-lock.json
|
|
||||||
html_body: |
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<h1>Heading</h1>
|
|
||||||
<p>Paragraph</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
- subject: file://testdata/subject.txt
|
|
||||||
convert_markdown: true
|
|
||||||
body: file://README.md
|
|
||||||
- subject: HTML body (Markdown)
|
|
||||||
convert_markdown: true
|
|
||||||
html_body: file://README.md
|
|
||||||
- subject: Multipart body (Markdown)
|
|
||||||
convert_markdown: true
|
|
||||||
body: file://README.md
|
|
||||||
html_body: file://README.md
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Send mail
|
- name: Send mail
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
server_address: ${{secrets.ADDRESS}}
|
connection_url: smtp://localhost:1025
|
||||||
server_port: 465
|
server_address: localhost
|
||||||
username: ${{secrets.USERNAME}}
|
server_port: 1025
|
||||||
password: ${{secrets.PASSWORD}}
|
secure: false
|
||||||
subject: ${{matrix.subject}}
|
username: test
|
||||||
body: ${{matrix.body}}
|
password: test
|
||||||
html_body: ${{matrix.html_body}}
|
subject: Test Email
|
||||||
to: ${{github.event.pusher.email}}
|
to: obiwan@example.com,yoda@example.com
|
||||||
from: github-actions
|
from: Luke Skywalker <luke@example.com>
|
||||||
attachments: ${{matrix.attachments}}
|
body: |-
|
||||||
convert_markdown: ${{matrix.convert_markdown}}
|
This is a test email sent from a GitHub Action.
|
||||||
|
Please check the attachments and other fields.
|
||||||
|
html_body: file://README.md
|
||||||
|
cc: leia@example.com
|
||||||
|
bcc: owen@example.com
|
||||||
|
reply_to: vader@example.com
|
||||||
|
in_reply_to: palpatine@example.com
|
||||||
|
ignore_cert: false
|
||||||
|
convert_markdown: true
|
||||||
|
attachments: package.json,action.yml
|
||||||
priority: high
|
priority: high
|
||||||
|
|
||||||
url-test:
|
- name: Get mail
|
||||||
runs-on: ubuntu-latest
|
run: |
|
||||||
steps:
|
curl -s "http://localhost:8025/api/v1/message/latest/raw"
|
||||||
- name: Checkout code
|
curl -s "http://localhost:8025/api/v1/message/latest" | jq
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Send mail
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
connection_url: smtp+starttls://${{secrets.USERNAME}}:${{secrets.PASSWORD}}@${{secrets.ADDRESS}}/
|
|
||||||
subject: Plain body with connection_url
|
|
||||||
body: |
|
|
||||||
first line
|
|
||||||
second line
|
|
||||||
to: ${{github.event.pusher.email}}
|
|
||||||
from: github-actions
|
|
||||||
|
Reference in New Issue
Block a user