Skip to content

Commit

Permalink
Fix yaml error in workflow validate tasks and add notification to val…
Browse files Browse the repository at this point in the history
…idate-push.
  • Loading branch information
toddking committed Aug 18, 2021
1 parent b50a454 commit f52587b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/validate-errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ jobs:
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# email subject
subject: ${{ steps.date.outputs.date }} ${{ job.status }}: ${{ github.job }} run on ${{ github.repository }}
subject: ${{ steps.date.outputs.date }} ${{ job.status }} - ${{ github.job }} run on ${{ github.repository }}
# email body as text
body: |
Run date: ${{ steps.date.outputs.date }}
Run date ${{ steps.date.outputs.date }}
${{ job.status }} of ${{ github.job }} run in workflow ${{ github.workflow }} of ${{ github.repository }}
""
--
For details see attachment.
# comma-separated string, send email to
to: ${{ secrets.EMAIL_LIST }},${{ secrets.EMAIL_TO }}
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/validate-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,54 @@ jobs:
fi
set -e
fi
notify:
name: Notify that a push has occurred
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Get changed files
uses: jitterbit/get-changed-files@v1
id: changed
with:
format: json
token: ${{ secrets.GITHUB_TOKEN }}
- name: Send mail
# Define the following secrets for the repository: EMAIL_SERVER, EMAIL_USERNAME, EMAIL_PASSWORD, EMAIL_TO, EMAIL_LIST
if: always()
uses: dawidd6/action-send-mail@v2
with:
# mail server settings
server_address: ${{ secrets.EMAIL_SERVER }}
server_port: 465
# user credentials
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# email subject
subject: ${{ steps.date.outputs.date }} ${{ github.repository }} push
# email body as text
body: |
Run date ${{ steps.date.outputs.date }}
${{ github.repository }} files added or updated:
--
Added
${{ steps.changed.outputs.added }}
--
Removed
${{ steps.changed.outputs.removed }}
--
Renamed
${{ steps.changed.outputs.renamed }}
--
Modified
${{ steps.changed.outputs.modified }}
--
Added+Modified:
${{ steps.changed.outputs.added_modified }}
# comma-separated string, send email to
to: ${{ secrets.EMAIL_LIST }},${{ secrets.EMAIL_TO }}
# from email name
from: HPDE Mailer
6 changes: 3 additions & 3 deletions .github/workflows/validate-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ jobs:
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# email subject
subject: ${{ steps.date.outputs.date }} ${{ job.status }}: ${{ github.job }} run on ${{ github.repository }}
subject: ${{ steps.date.outputs.date }} ${{ job.status }} - ${{ github.job }} run on ${{ github.repository }}
# email body as text
body: |
Run date: ${{ steps.date.outputs.date }}
Run date ${{ steps.date.outputs.date }}
${{ job.status }} of ${{ github.job }} run in workflow ${{ github.workflow }} of ${{ github.repository }}
""
--
For details see attachment.
# comma-separated string, send email to
to: ${{ secrets.EMAIL_LIST }},${{ secrets.EMAIL_TO }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ jobs:
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# email subject
subject: ${{ steps.date.outputs.date }} ${{ job.status }}: ${{ github.job }} run on ${{ github.repository }}
subject: ${{ steps.date.outputs.date }} ${{ job.status }} - ${{ github.job }} run on ${{ github.repository }}
# email body as text
body: |
Run date: ${{ steps.date.outputs.date }}
Run date ${{ steps.date.outputs.date }}
${{ job.status }} of ${{ github.job }} run in workflow ${{ github.workflow }} of ${{ github.repository }}
""
--
For details see attachment.
# comma-separated string, send email to
to: ${{ secrets.EMAIL_LIST }},${{ secrets.EMAIL_TO }}
Expand Down

0 comments on commit f52587b

Please sign in to comment.