diff --git a/.github/workflows/mainnet-deploy.yml b/.github/workflows/mainnet-deploy.yml index eff5f925..d91e367f 100644 --- a/.github/workflows/mainnet-deploy.yml +++ b/.github/workflows/mainnet-deploy.yml @@ -27,18 +27,21 @@ jobs: if: ${{ inputs.version == 'latest' || startsWith(inputs.version, 'v.') }} steps: + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + with: + fetch-depth: 0 + fetch-tags: true + persist-credentials: false + - name: Find latest tag if: inputs.version == 'latest' id: find-latest-tag run: | echo "LATEST_TAG=$(git tag -l | sort -V | tail -n1)" >> $GITHUB_OUTPUT - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - with: - fetch-depth: 0 - fetch-tags: true - ref: ${{ inputs.version == 'latest' && steps.find-latest-tag.outputs.LATEST_TAG || inputs.version }} - persist-credentials: false + - name: Checkout selected ref + run: | + git checkout "${{ inputs.version == 'latest' && steps.find-latest-tag.outputs.LATEST_TAG || inputs.version }}" - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/testnet-deploy.yml b/.github/workflows/testnet-deploy.yml index c5e7ff45..b1883938 100644 --- a/.github/workflows/testnet-deploy.yml +++ b/.github/workflows/testnet-deploy.yml @@ -5,6 +5,7 @@ on: branches: - main paths: ['apps/frontend/**', 'packages/**', 'yarn.lock'] + types: [opened, reopened, synchronize] push: branches: @@ -94,11 +95,19 @@ jobs: echo "🌐 Deployed: https://vevote-dev.vechain.org/" | tee -a "$GITHUB_STEP_SUMMARY" fi - - name: Create Deployment Comment # only create comment if pull request is opened or reopened or draft - if: github.event.action == 'opened' || github.event.action == 'reopened' || github.event.pull_request.draft == true + - name: Find Comment + uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0 + id: find-comment + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: '🚀 Preview environment deployed!' + + - name: Create Deployment Comment uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 with: issue-number: ${{ github.event.pull_request.number }} + comment-id: ${{ steps.find-comment.outputs.comment-id }} body: | # 🚀 Preview environment deployed! Preview URL: https://preview.vevote-dev.vechain.org${{ steps.process-branch-name.outputs.processedBranchName }}