Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/check-release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Release Branch for Main Merge

on:
pull_request:
branches:
- main

jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Check source branch name
run: |
SOURCE_BRANCH="${{ github.head_ref }}"
echo "Source branch: $SOURCE_BRANCH"
if [[ "$SOURCE_BRANCH" != release/* ]]; then
echo "::error::Pull Request from branch '$SOURCE_BRANCH' cannot be merged into 'main'. Only branches starting with 'release/' are allowed."
exit 1
else
echo "Source branch '$SOURCE_BRANCH' is a valid release branch."
fi
163 changes: 0 additions & 163 deletions .github/workflows/ci.yml

This file was deleted.

19 changes: 16 additions & 3 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.sha,
environment: 'preview',
environment: 'Preview',
transient_environment: true,
description: 'Deploying Preview from PR'
});
Expand All @@ -81,7 +81,19 @@ jobs:
# --- FASE 2: EXECUTAR O DEPLOY NA VERCEL ---
- name: Deploy to Vercel and Capture URL
id: deploy_step
run: echo "preview_url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT
run: |

DEPLOY_COMMAND="vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}"

# Execute Vercel deploy e capture sua saída e status
if DEPLOY_URL=$($DEPLOY_COMMAND); then
echo "Deployment successful."
echo "preview_url=$DEPLOY_URL" >> $GITHUB_OUTPUT
else
DEPLOY_STATUS=$?
echo "Error: Vercel deploy failed with exit code $DEPLOY_STATUS."
exit $DEPLOY_STATUS
fi

- name: Find Previous Comment
uses: peter-evans/find-comment@v3
Expand Down Expand Up @@ -116,7 +128,8 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const finalState = '${{ job.status }}' === 'success'? 'success' : 'failure';
const deployOutcome = '${{ steps.deploy_step.outcome }}';
const finalState = (deployOutcome === 'success' && '${{ job.status }}' === 'success') ? 'success' : 'failure';
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
Loading