Skip to content
Discussion options

You must be logged in to vote

hey @cunhajo-code here are the steps you can check

The Problem: GitHub Security Rules

Turns out GitHub now blocks pushes that look like you're committing sensitive data, even if it's obviously fake stuff from a tutorial.

In my case, the code had a hardcoded JWT secret like this:

const jwtSecret = 'mysecretkey';

That alone was enough for GitHub to block the push due to secret scanning rules. No detailed error message. Just... "push declined."

The Fix

Here’s what finally worked for me:

1. Remove or Hide the Secrets

Change hardcoded secrets to use environment variables:

const jwtSecret = process.env.JWT_SECRET;

Then put your secrets in a .env file and add .env to .gitignore:

echo ".env" >> .…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@rossmacrae
Comment options

Answer selected by cunhajo-code
Comment options

You must be logged in to vote
1 reply
@AyushSingh360
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants