Skip to content

Commit

Permalink
Added secrets for security
Browse files Browse the repository at this point in the history
  • Loading branch information
sharmnten committed Dec 29, 2024
1 parent f1a4e2e commit e1e5183
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
from appwrite.services.users import Users
from appwrite.services.databases import Databases
from appwrite.exception import AppwriteException
import os


endpoint = os.getenv("API_ENDPOINT")
key = os.getenv("API_KEY")
project = os.getenv("PROJECT_ID")


def main(context, userId, amount):
client = (
Client()
.set_endpoint('https://cloud.appwrite.io/v1')
.set_project('67609b010021900fc6e6')
.set_key('standard_a766a87da91bf274575dc294722839045769920a97a36eed295705391e817cad896c81e52c5dd654b6e7b3e6ec13bd16f3d607e416a543d5813d0aab7d7eae27af014a01aa74c503196056bd82eea708c844f1dcbba43f42d81a8a1c455727e6c93536fa6de367f8b92c23961ef1e9982f40c6b9caf1b46064515391dd1de308')
.set_endpoint(endpoint)
.set_project(key)
.set_key(project)
)
users = Users(client)
databases = Databases(client)
Expand Down
33 changes: 33 additions & 0 deletions workflows/get-secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Get Secrets Workflow

on:
workflow_dispatch: # Allows manual triggering of the workflow
inputs:
API_ENDPOINT:
description: "Name of the first secret"
required: true
API_KEY:
description: "Name of the second secret"
required: true
PROJECT_ID:
description: "Name of the third secret"
required: true

jobs:
retrieve-secrets:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Retrieve Secrets
env:
API_ENDPOINT: ${{ secrets.API_ENDPOINT }}
API_KEY: ${{ secrets.API_KEY }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
run: |
echo "Retrieving Secrets..."
echo "First Secret: $API_ENDPOINT"
echo "Second Secret: $API_KEY"
echo "Third Secret: $PROJECT_ID"

0 comments on commit e1e5183

Please sign in to comment.