This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import json | |
| import requests | |
| import psycopg2 | |
| from datetime import datetime | |
| def lambda_handler(event, context): | |
| # GitHub API URL for custom properties | |
| repo_owner = os.getenv("REPO_OWNER") | |
| repo_name = os.getenv("REPO_NAME") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import pandas as pd | |
| import requests | |
| from dotenv import load_dotenv | |
| from datetime import datetime | |
| # Load the .env file | |
| load_dotenv() | |
| # Step 1: Retrieve the GitHub PAT and proxy credentials from environment variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Client } = require('pg'); | |
| const axios = require('axios'); | |
| // Set debug mode | |
| const debug = true; // Set to false to make actual API calls | |
| // Database connection string | |
| const connectionString = [CONNECTION STRING FROM DX] | |
| // Create a new PostgreSQL client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Client } = require('pg'); | |
| const axios = require('axios'); | |
| // Set debug mode | |
| const debug = true; // Set to false to make actual API calls | |
| // Database connection string | |
| const connectionString = [CONNECTION STRING FROM DX] | |
| // Create a new PostgreSQL client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| # Function to generate insert statements from CSV data and write them to a SQL file | |
| def generate_insert_statements(csv_file_path, output_sql_file): | |
| insert_statements = [] | |
| with open(csv_file_path, 'r') as file: | |
| reader = csv.DictReader(file) | |
| with open(output_sql_file, 'w') as sql_file: | |
| for row in reader: | |
| namespace = row['namespace'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import requests | |
| import pandas as pd | |
| from dotenv import load_dotenv | |
| from datetime import datetime | |
| import time | |
| # Load environment variables | |
| load_dotenv() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import requests | |
| import jwt | |
| import time | |
| # Load environment variables | |
| app_id = os.getenv('GITHUB_APP_ID') | |
| private_key_file = os.getenv('GITHUB_RSA_PRIVATE_KEY_PATH') | |
| DX_PROXY_USER = os.getenv('DX_PROXY_USER') | |
| DX_PROXY_PASS = os.getenv('DX_PROXY_PASS') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Client } = require('pg'); | |
| const axios = require('axios'); | |
| // Debug mode | |
| const debug = true; // Set to false for real API calls | |
| // Database connection string | |
| const connectionString = '[CONNECTION STRING FROM DX]'; | |
| // DX API endpoint and token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Initial URL for the groups endpoint with pagination (max 100 items per page) | |
| base_url='https://git.ws.cgm.com/api/v4/groups?per_page=100' | |
| # Authentication token and proxy setup | |
| token='cgmglpat-fL<TOKEN REMOVED>HHz' | |
| proxy="http://$DX_PROXY_USER:$DX_PROXY_PASS@proxy.getdx.net:80" | |
| # Initialize variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import jwt # PyJWT | |
| import requests | |
| import pandas as pd | |
| from dotenv import load_dotenv | |
| from datetime import datetime, timedelta | |
| import time | |
| # Load environment variables | |
| load_dotenv() |