From 7db181673a50454cecb86b83c90ff4f54cebe068 Mon Sep 17 00:00:00 2001 From: Keming Date: Wed, 24 Jan 2024 14:19:18 +0800 Subject: [PATCH] chore: nightly token that can trigger the release workflow (#303) * chore: allow tag to have a v-prefix Signed-off-by: Keming * debug output Signed-off-by: Keming * set job output Signed-off-by: Keming * fix needs Signed-off-by: Keming * fix nightly token Signed-off-by: Keming --------- Signed-off-by: Keming --- .github/workflows/nightly.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2106a491b..996e0e060 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,23 +6,22 @@ on: - cron: "0 16 * * *" workflow_dispatch: -permissions: - actions: write - jobs: setup: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.NIGHTLY_TOKEN }} + permissions: + contents: write steps: - name: Checkout uses: actions/checkout@v4 - run: | commit_date=$(git log -1 --since="24 hours ago" --pretty=format:"%cI") if [[ -n "$commit_date" ]]; then - if $(gh release view nightly); then - gh release edit 0.0.0-nightly --target main + if $(gh release view v0.0.0-nightly); then + gh release edit v0.0.0-nightly --target main else - gh release create 0.0.0-nightly --generate-notes --prerelease + gh release create v0.0.0-nightly --generate-notes --prerelease fi fi - env: - GH_TOKEN: ${{ github.token }}