Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dummy cron job to create PRs/issues/zulip-threads #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/cronny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: weekly cron job

on:
schedule:
- cron: '44 4 * * *' # At 4:44 UTC every day.

defaults:
run:
shell: bash

jobs:
cake:
name: Pingy McPingface
runs-on: ubuntu-latest
steps:
# Send a Zulip notification
- name: Install zulip-send
run: pip3 install zulip
- name: Send Zulip notification
env:
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
run: |
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
--stream miri --subject "Weekly reminder to do The Thing (TM)" \
--message 'Dear @*T-types*,

It would appear that the [Weekly cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') wants you do to something.

Thanks in advance!
Sincerely,
Pingy McPingface'

- name: setup bot git name and email
run: |
git config --global user.name 'Pingy McPingface'
git config --global user.email 'types@cron.bot'
- name: Push changes to a branch
run: |
BRANCH="weekly-$(date -u +%Y-%m-%d)"
git switch -c $BRANCH
git push -u origin $BRANCH
- name: Create Pull Request
run: |
PR=$(gh pr create -B master --title 'There ya go' --body 'bop')
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
--stream t-types/meetings --subject "Pingy McPingface ($(date -u +%Y-%m))" \
--message "A PR [has been automatically created]($PR) for your convenience."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}