-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (25 loc) · 874 Bytes
/
random-commit.yml
File metadata and controls
30 lines (25 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Random Activity
on:
schedule:
- cron: '0 6 * * *' # Runs daily at 6 AM UTC
workflow_dispatch:
jobs:
random-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Generate random number (0-9)
id: random
run: echo "RANDOM_NUMBER=$((RANDOM % 10))" >> $GITHUB_ENV
- name: Show random number
run: echo "Random number was $RANDOM_NUMBER"
- name: Maybe commit (if number is 0-5)
if: ${{ env.RANDOM_NUMBER <= 5 }}
run: |
echo "Logging activity at $(date)" >> activity.txt
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add activity.txt
git commit -m "Random activity $(date)"
git push