Skip to content

Commit 80f8e82

Browse files
Removed emailing on success/failure.
Frankly, the emailing itself has always ended up being flakier than running the tests. This isn't providing a value-add. (At least to me, and I maintain this project 😈)
1 parent df54820 commit 80f8e82

2 files changed

Lines changed: 0 additions & 66 deletions

File tree

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ This action will:
1212
- An annotated git tag is added;
1313
- A GitHub Release is made
1414
- The sdist and wheel are both uploaded to PyPI.
15-
- You will receive an email confirming the success.
16-
- Else:
17-
- You will receive an email reporting the failure.
1815

1916
### Usage
2017

@@ -47,10 +44,6 @@ jobs:
4744
pypi-token: ${{ secrets.pypi_token }}
4845
github-user: your-username-here
4946
github-token: ${{ github.token }} # automatically created token
50-
email-user: your-email-here@example.com
51-
email-token: ${{ secrets.email_token }}
52-
email-server: example.com:587
53-
email-target: your-email-here@example.com
5447
```
5548

5649
This will run every time the `main` branch is updated. If the version has updated, then it will trigger things as described above.
@@ -65,10 +58,6 @@ The following are options for passing to `with`:
6558
- `pypi-token`: What password or token to use when pushing to PyPI.
6659
- `github-user`: What GitHub user to use when authenticating the release with GitHub.
6760
- `github-token`: What GitHub token to use when authenticating the release with GitHub.
68-
- `email-user`: What email to send success/failure notifications from.
69-
- `email-token`: The corresponding password.
70-
- `email-server`: Address of the SMTP server; `email-user` and `email-token` will be used to authenticate with this server. This must not have any "https://" prefix. It must include a port number at the end; on most servers this will be 587.
71-
- `email-target`: What email to send success/failure notifications to.
7261

7362
Notes on `test-script`:
7463

action.yml

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@ inputs:
2020
test-script:
2121
description: 'The script for the tests.'
2222
required: true
23-
email-user:
24-
description: 'An email to send notifications from.'
25-
required: true
26-
email-token:
27-
description: 'Password for the email to send notifications from.'
28-
required: true
29-
email-server:
30-
description: 'An SMTP server to send emails from.'
31-
required: true
32-
email-target:
33-
description: 'An email to report successes and failures to.'
34-
required: true
35-
email-starttls:
36-
description: 'Explicitly starttls to connect to SMTP server'
37-
default: false
3823
branding:
3924
icon: 'wind'
4025
color: 'yellow'
@@ -159,46 +144,6 @@ runs:
159144
with:
160145
user: ${{ inputs.pypi-user }}
161146
password: ${{ inputs.pypi-token }}
162-
163-
- name: Email on success
164-
if: (steps.get-versions.outputs.new-version == 'true') && (steps.test-sdist.outputs.result == 'true') && (steps.test-bdist-wheel.outputs.result == 'true')
165-
shell: bash
166-
run: |
167-
python -c "
168-
from smtplib import SMTP
169-
from email.mime.text import MIMEText
170-
from_ = '${{ inputs.email-user }}'
171-
to = '${{ inputs.email-target }}'
172-
msg = MIMEText('')
173-
msg['From'] = from_
174-
msg['To'] = to
175-
msg['Subject'] = 'Deploy success | ${{ github.repository }} ${{ steps.get-versions.outputs.tag }}'
176-
with SMTP('${{ inputs.email-server }}') as s:
177-
if ${{ inputs.email-starttls }} == 'true':
178-
s.starttls()
179-
s.login('${{ inputs.email-user }}', '${{ inputs.email-token }}')
180-
s.sendmail(from_, [to], msg.as_string())
181-
"
182-
183-
- name: Email on failure
184-
if: (steps.get-versions.outputs.new-version == 'true') && ((steps.test-sdist.outputs.result != 'true') || (steps.test-bdist-wheel.outputs.result != 'true'))
185-
shell: bash
186-
run: |
187-
python -c "
188-
from smtplib import SMTP
189-
from email.mime.text import MIMEText
190-
from_ = '${{ inputs.email-user }}'
191-
to = '${{ inputs.email-target }}'
192-
msg = MIMEText('')
193-
msg['From'] = from_
194-
msg['To'] = to
195-
msg['Subject'] = 'Deploy ERROR | ${{ github.repository }} ${{ steps.get-versions.outputs.tag }}'
196-
with SMTP('${{ inputs.email-server }}') as s:
197-
if ${{ inputs.email-starttls }} == 'true':
198-
s.starttls()
199-
s.login('${{ inputs.email-user }}', '${{ inputs.email-token }}')
200-
s.sendmail(from_, [to], msg.as_string())
201-
"
202147

203148
- name: Fail
204149
if: (steps.get-versions.outputs.new-version == 'true') && ((steps.test-sdist.outputs.result != 'true') || (steps.test-bdist-wheel.outputs.result != 'true'))

0 commit comments

Comments
 (0)