Skip to content

Commit

Permalink
adding workflow to update files on api
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalaurentiu committed Sep 18, 2023
1 parent 93fd8b5 commit bf63208
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/updateApi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Python application

on:
push:
branches: [ main ]
pull_request:
types:
- closed

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip3 install requests
- name: Update API
run: |
python3 apiUpdateFiles.py
12 changes: 12 additions & 0 deletions apiUpdateFiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import requests

url = "https://dev.laurentiumarian.ro/scraper/JobsScrapers/"

r = requests.post(url, data = {"update": "true"})

response = r.json()

if response.get("succes"):
print(response.get("succes"))
else:
print(response.get("error"))

0 comments on commit bf63208

Please sign in to comment.