GitHub Actions
The inboxdome/email-testing-action gives your CI three steps:create an inbox, wait for an email/OTP, andassert on what arrived. Store your API key as theINBOXDOME_API_KEY repository secret.
jobs:
signup-email-test:
runs-on: ubuntu-latest
steps:
- name: Create inbox
id: inbox
uses: inboxdome/email-testing-action@v1
with:
api-key: ${{ secrets.INBOXDOME_API_KEY }}
mode: create
- name: Sign up with the temporary address
run: ./scripts/signup.sh "${{ steps.inbox.outputs.email-address }}"
- name: Wait for the OTP
id: otp
uses: inboxdome/email-testing-action@v1
with:
api-key: ${{ secrets.INBOXDOME_API_KEY }}
mode: wait
inbox-id: ${{ steps.inbox.outputs.inbox-id }}
wait-for: otp
timeout-seconds: 90
- name: Verify the account with the code
run: ./scripts/verify.sh "${{ steps.otp.outputs.otp }}"
- name: Assert on the welcome email
uses: inboxdome/email-testing-action@v1
with:
api-key: ${{ secrets.INBOXDOME_API_KEY }}
mode: assert
inbox-id: ${{ steps.inbox.outputs.inbox-id }}
assertions: >-
[{"type":"containsText","text":"Welcome"},
{"type":"linkResponds","urlContains":"verify"},
{"type":"auth","check":"dkim"}]Modes
| Mode | Inputs | Outputs |
|---|---|---|
create | domain?, ttl-seconds? | inbox-id, email-address |
wait | inbox-id, wait-for, timeout-seconds | otp, message-id, message-subject |
assert | inbox-id, assertions (JSON), fail-on-assertion-failure | passed, report |
Prefer plain HTTP? The action is a thin curl wrapper over theREST API — everything works with two curl calls too.