PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, August 20, 2022

[FIXED] How To Access Repository Secret

 August 20, 2022     environment-variables, github, operating-system, python, python-3.x     No comments   

Issue

I've made a repository on GitHub and have added a Repository secret. However, I can't seem to grab the secret's value. Any help would be greatly appreciated!


Solution

So I made a workaround for this. Instead of using GitHub to store my secrets, I used a .env file and .gitignore to hide this file.

Giving a TOKEN value in the .env file, I call it within Python by importing os and dotenv like so:

from dotenv import load_dotenv
load_dotenv()

import os
token = os.getenv("TOKEN")


Answered By - Larry-Larriee
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing