Skip to content

Commit 4952518

Browse files
committed
test bot
0 parents  commit 4952518

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Create Timestamp File
2+
3+
on:
4+
schedule:
5+
- cron: "*/5 * * * *" # Run every 5 minutes
6+
workflow_dispatch: # Allow manual trigger
7+
8+
jobs:
9+
create-timestamp:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Git
19+
run: |
20+
git config --local user.name "github-actions[bot]"
21+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
22+
23+
- name: Create timestamp file
24+
run: |
25+
timestamp=$(date +"%Y%m%d_%H%M%S")
26+
mkdir -p timestamps
27+
echo "Timestamp: $(date)" > "timestamps/timestamp_${timestamp}.txt"
28+
29+
- name: Commit and push
30+
run: |
31+
git add .
32+
git commit -m "Add timestamp file $(date +"%Y-%m-%d %H:%M:%S")"
33+
git push

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Daily Timestamp Creator
2+
3+
This repository contains a GitHub Action that automatically creates timestamped files every 5 minutes.
4+
5+
## How it works
6+
7+
1. A GitHub Action workflow runs every 5 minutes
8+
2. It creates a new text file with the current timestamp in the `timestamps` directory
9+
3. The file is committed and pushed automatically by the GitHub Actions bot
10+
11+
## Manual trigger
12+
13+
You can also manually trigger the workflow through the Actions tab in the GitHub repository.
14+
15+
## Files
16+
17+
All timestamp files are stored in the `timestamps/` directory with the format `timestamp_YYYYMMDD_HHMMSS.txt`.

0 commit comments

Comments
 (0)