Update setup.yml #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: send_newsletter | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
if: (github.event.commits[0].message != 'Initial commit') && (github.run_number != 1) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check how many | |
id: number_check | |
run: | | |
echo "::set-output name=number::$(ls ./current/*.yaml | wc -l)" | |
- name: Set up Go | |
if: steps.number_check.outputs.number == 4 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
# Runs a single command using the runners shell | |
- name: Send Newsletter | |
if: steps.number_check.outputs.number == 4 | |
env: | |
EMAIL: ${{ secrets.EMAIL }} | |
PASSWORD: ${{ secrets.EMAIL_PASSWORD }} | |
run: cd ./src && go run main.go publish current | |
- name: Commit Changes | |
if: steps.number_check.outputs.number == 4 | |
run: | | |
git config --global user.name 'Chansung' | |
git config --global user.email '[email protected]' | |
git add . | |
git commit -m "Automated report" | |
git push |