Skip to content

Commit 75cccaf

Browse files
authored
Create cron_job.yml
1 parent 5c9b46a commit 75cccaf

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/cron_job.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: GitHub API Cronjob
2+
3+
on:
4+
schedule:
5+
- cron: '* * * * *' # chạy mỗi phút
6+
workflow_dispatch: # cho phép chạy thủ công
7+
8+
jobs:
9+
call-api:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Run
14+
run: echo "$(date) - Sending request to GitHub API"
15+
16+
- name: Gọi GitHub API
17+
run: |
18+
curl -L \
19+
-H "Accept: application/vnd.github+json" \
20+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN_API }}" \
21+
-H "X-GitHub-Api-Version: 2022-11-28" \
22+
https://api.github.com/orgs/masan-group/copilot/metrics
23+
24+
- name: Save file
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: github-api-log
28+
path: my_log.txt

0 commit comments

Comments
 (0)