'How To Access Repository Secret

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 1:[1]

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")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Larry-Larriee