Skip to content

fix: remove token from checkout, authenticate push via remote URL#94

Merged
rviannaoliveira merged 1 commit intomainfrom
fix/checkout-no-token
Mar 29, 2026
Merged

fix: remove token from checkout, authenticate push via remote URL#94
rviannaoliveira merged 1 commit intomainfrom
fix/checkout-no-token

Conversation

@rviannaoliveira
Copy link
Copy Markdown
Contributor

Problema

O checkout falhava com could not read Username porque o GH_PAT estava sendo passado como token no actions/checkout. Para um repo público, isso causa falha no fetch quando o token está mal configurado ou vazio.

Correção

  • Checkout: sem token (repo público, leitura não precisa de auth)
  • Push: autentica explicitamente via URL do remote com GH_PAT
  • PR creation: continua usando GH_TOKEN: GH_PAT
# Antes ❌
uses: actions/checkout@v4
with:
  token: ${{ secrets.GH_PAT }}  # falha se token inválido

# Depois ✅
uses: actions/checkout@v4
# sem token

# push autentica via remote URL
git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/CodandoTV/CraftD.git

🤖 Generated with Claude Code

@rviannaoliveira rviannaoliveira merged commit cdf2115 into main Mar 29, 2026
0 of 2 checks passed
@rviannaoliveira rviannaoliveira deleted the fix/checkout-no-token branch March 29, 2026 12:29
@rviannaoliveira rviannaoliveira restored the fix/checkout-no-token branch March 29, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant