-
Notifications
You must be signed in to change notification settings - Fork 206
36 lines (31 loc) · 1.05 KB
/
release_cron_daily.yml
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
31
32
33
34
35
36
name: Daily Pre-release
on:
schedule:
- cron: '0 0 * * 1-5' # Runs Mon-Fri at midnight UTC
workflow_dispatch: # Allows manual trigger if needed
jobs:
create-pre-release:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main # Ensure we are working with the main branch
- name: Get latest commit hash
id: get_latest_commit
run: echo "COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Create Pre-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{
"tag_name": "$(date +%Y%m%d)",
"target_commitish": "${{ env.COMMIT_SHA }}",
"name": "Pre-release $(date +%Y-%m-%d)",
"body": "Daily pre-release for $(date +%Y-%m-%d).",
"prerelease": true
}'