-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tag all commits to the default branch with 'unstable' and add an auto…
… generated 'nightly' tag (#1220) * Tag all commits to the default branch with 'nightly' * Swap nightly around, add unstable tag * Run at 23:55 and use createRef
- Loading branch information
1 parent
35bdc0a
commit 30c517c
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This workflow will create a 'nightly' tag once a day at midnight | ||
# For more information see: https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#update-a-reference | ||
|
||
name: Tag Default Branch Commits with Nightly | ||
|
||
on: | ||
schedule: | ||
- cron: "55 23 * * *" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
- name: Update nigtly tag | ||
uses: actions/github-script@v5 | ||
env: | ||
TAG_DATE: ${{ steps.date.outputs.date }} | ||
with: | ||
script: | | ||
const { TAG_DATE } = process.env | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: `refs/tags/nightly-${TAG_DATE}`, | ||
sha: context.sha | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This workflow will tag all commits to the default branch with 'unstable' | ||
# For more information see: https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#update-a-reference | ||
|
||
name: Tag Default Branch Commits with Unstable | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Update unstable tag | ||
uses: actions/github-script@v5 | ||
with: | ||
script: | | ||
github.rest.git.updateRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/unstable', | ||
force: true, | ||
sha: context.sha | ||
}) |