Cut Nightly #228
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cut Nightly | |
on: | |
schedule: | |
- cron: '30 9 * * *' | |
workflow_dispatch: | |
jobs: | |
cut_nightly: | |
runs-on: ubuntu-latest | |
environment: trigger-nightly | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
token: ${{ secrets.GH_PYTORCHBOT_TOKEN }} | |
- name: Create nightly commit | |
shell: bash | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "pytorchbot" | |
git fetch origin nightly | |
HEAD_COMMIT_HASH=$(git rev-parse HEAD) | |
NIGHTLY_DATE=$(date +"%Y-%m-%d") | |
# shellcheck disable=SC1083 | |
NIGHTLY_RELEASE_COMMIT=$(git commit-tree -p FETCH_HEAD HEAD^{tree} -m "${NIGHTLY_DATE} nightly release (${HEAD_COMMIT_HASH})") | |
# shellcheck disable=SC1083 | |
git push -f origin "${NIGHTLY_RELEASE_COMMIT}:nightly" |