Moved token to env variable
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import requests
|
||||
from flask import Flask, request
|
||||
from prometheus_client import generate_latest, Gauge, CollectorRegistry
|
||||
@@ -17,7 +19,10 @@ github_latest_release_metric = Gauge(
|
||||
)
|
||||
|
||||
# GitHub API token (replace with your actual token)
|
||||
github_api_token = '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'
|
||||
github_api_token = os.environ.get('GITHUB_TOKEN')
|
||||
|
||||
if github_api_token is None:
|
||||
sys.exit("Env variable GITHUB_TOKEN not found!")
|
||||
|
||||
# Function to fetch the latest release version or the latest tag from GitHub
|
||||
def get_latest_version(repo_url):
|
||||
|
||||
Reference in New Issue
Block a user