Skip to content

Daily Pre-release

Daily Pre-release #2

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
}'