diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000..a535ba4558 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -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 + }) diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml new file mode 100644 index 0000000000..f5bd2e9399 --- /dev/null +++ b/.github/workflows/unstable.yml @@ -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 + })