mirror of https://github.com/Bunsly/JobSpy
72 lines
2.0 KiB
YAML
72 lines
2.0 KiB
YAML
name: JobSpy Scraper Dynamic Workflow
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
user_email:
|
|
description: 'User email for the scraper'
|
|
required: true
|
|
default: 'branden@autoemployme.onmicrosoft.com'
|
|
search_terms:
|
|
description: 'Comma-separated list of search terms'
|
|
required: true
|
|
default: 'IT Support,CRM,Automation'
|
|
results_wanted:
|
|
description: 'Number of results to fetch'
|
|
required: true
|
|
default: '100'
|
|
max_days_old:
|
|
description: 'Fetch jobs posted in the last n days'
|
|
required: true
|
|
default: '2'
|
|
target_state:
|
|
description: 'Target state (e.g. NY)'
|
|
required: true
|
|
default: 'NY'
|
|
|
|
permissions:
|
|
actions: read
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
scrape_jobs:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Write user-specific config.json
|
|
run: |
|
|
echo "{
|
|
\"user_email\": \"${{ github.event.inputs.user_email }}\",
|
|
\"search_terms\": [\"${{ github.event.inputs.search_terms }}\"],
|
|
\"results_wanted\": ${{ github.event.inputs.results_wanted }},
|
|
\"max_days_old\": ${{ github.event.inputs.max_days_old }},
|
|
\"target_state\": \"${{ github.event.inputs.target_state }}\"
|
|
}" > config.json
|
|
|
|
- name: Run JobSpy Scraper Dynamic
|
|
run: python job_scraper_dynamic.py
|
|
|
|
- name: Upload user-specific CSV as artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: jobspy-output-${{ github.event.inputs.user_email }}
|
|
path: |
|
|
jobspy_output_dynamic_${{ github.event.inputs.user_email }}
|
|
.replace('@','_at_')
|
|
.replace('.','_')
|
|
.csv
|