From dc44e58f33de048df1f05e9cf54a004bf019a281 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Sat, 6 Apr 2024 12:52:12 +0200 Subject: [PATCH] ci(patch): Update tag with main Signed-off-by: rjshrjndrn --- .github/workflows/update-tag.yaml | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/update-tag.yaml diff --git a/.github/workflows/update-tag.yaml b/.github/workflows/update-tag.yaml new file mode 100644 index 000000000..6b1c67a22 --- /dev/null +++ b/.github/workflows/update-tag.yaml @@ -0,0 +1,35 @@ +on: + workflow_dispatch: + description: 'This workflow will build for patches for latest tag, and will Always use commit from main branch.' + inputs: + services: + description: 'This action will update the latest tag with current main branch HEAD. Should I proceed ? true/false' + required: true + default: 'false' + +name: Force Push tag with main branch HEAD + +jobs: + deploy: + name: Build Patch from main + runs-on: ubuntu-latest + env: + DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }} + DEPOT_PROJECT_ID: ${{ secrets.DEPOT_PROJECT_ID }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set Remote with GITHUB_TOKEN + run: | + git config --unset http.https://github.com/.extraheader + git remote set-url origin https://x-access-token:${{ secrets.ACTIONS_COMMMIT_TOKEN }}@github.com/${{ github.repository }}.git + - name: Push main branch to tag + run: | + git fetch --tags + git checkout main + git push origin HEAD:refs/tags/$(git describe --tags `git rev-list --tags --max-count=1`) --force + - name: Debug Job + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true