Skip to content

Commit

Permalink
variables de entorno configuradas en guthub
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioarcez committed Feb 7, 2025
1 parent ee6a8f0 commit ded7e4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/scraping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
python-version: '3.8'

- name: Instalar dependencias
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
Expand Down Expand Up @@ -49,6 +49,11 @@ jobs:

- name: Ejecutar scraping
if: ${{ steps.check_date.outputs.should_scrape == 'true' }}
env:
API_KEY: ${{ secrets.API_KEY }}
API_SECRET: ${{ secrets.API_SECRET }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
ACCESS_SECRET: ${{ secrets.ACCESS_SECRET }}
run: python -m src.main

- name: Commit y push de datos
Expand Down
4 changes: 2 additions & 2 deletions src/publicar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
format='%(asctime)s - %(levelname)s - %(message)s'
)

# Cargar variables de entorno
# Cargar variables de entorno (para pruebas locales)
load_dotenv()

# Acceder a las variables de entorno
Expand All @@ -20,7 +20,7 @@
access_token = os.environ["ACCESS_TOKEN"] # Token de acceso
access_secret = os.environ["ACCESS_SECRET"] # Secreto del token de acceso
except KeyError as e:
print(f"Error: La variable de entorno {e} no está configurada.")
logging.error(f"Error: La variable de entorno {e} no está configurada.")
raise


Expand Down

0 comments on commit ded7e4a

Please sign in to comment.