Send Updates #1405
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
on: | |
push: | |
branches: | |
- 'main' | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '30 2 * * *' | |
# reddit access for golang tests | |
# since I am an single dev | |
# what I care about is regression | |
# making sure my code still works on the reddit api | |
env: | |
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }} | |
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} | |
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }} | |
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }} | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_REDDIT_WEBHOOK}} | |
name: Send Updates | |
jobs: | |
run: | |
strategy: | |
matrix: | |
go-version: [1.15.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install Go | |
if: success() | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run job | |
run: go run cmd/main.go | |
- name: Commit files | |
id: commit | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add internal/*.csv | |
git commit -m "Updating csv" | |
continue-on-error: true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
if: steps.commit.outputs.status == 'success' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |