How would that work? You don't control github.com servers so your repo would never see the secret.
edit: You may want to look into tokenizing proxies as the general application of this concept.
Your agent writes secret.txt with the placeholder, and the tokenizing proxy replaces it with the token, then the agent reads secret.txt
Your agent writes secret.txt with the placeholder, and the tokenizing proxy replaces it with the token, then the agent reads secret.txt