run-app #34
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: run-app | |
on: | |
schedule: | |
- cron: "0 1 * * *" # run at 1 AM UTC on weekdays | |
workflow_dispatch: | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
name: send status update | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{secrets.PAT}} | |
- name: setup | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: './go.mod' | |
- name: run app | |
run: | | |
go run . | |
gh secret set X_REFRESH_TOKEN --body "$NEW_X_REFRESH_TOKEN" | |
env: | |
MASTODON_SERVER: ${{ secrets.MASTODON_SERVER }} | |
MASTODON_CLIENT_ID: ${{ secrets.MASTODON_CLIENT_ID }} | |
MASTODON_SECRET_KEY: ${{ secrets.MASTODON_SECRET_KEY }} | |
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
X_CLIENT_ID: ${{ secrets.X_CLIENT_ID }} | |
X_CLIENT_SECRET: ${{ secrets.X_CLIENT_SECRET }} | |
X_REFRESH_TOKEN: ${{ secrets.X_REFRESH_TOKEN }} | |
GH_TOKEN: ${{secrets.PAT}} | |
- name: commit | |
run: | | |
git config --global user.email "gh-actions" | |
git config --global user.name "gh-actions" | |
branch="store-changes-$(date +%s)" | |
git checkout -b $branch | |
git commit -a -m "Store changes to data." | |
git push --set-upstream origin $branch | |
url=$(gh pr create --fill) | |
gh pr merge --auto --merge "$url" | |
env: | |
GH_TOKEN: ${{secrets.PAT}} |