Skip to content

Weekly PMC Mining Workflow #37

Weekly PMC Mining Workflow

Weekly PMC Mining Workflow #37

Workflow file for this run

name: Weekly PMC Mining Workflow
on:
schedule:
# Run every Monday at 10:00 PM UTC (to avoid Synapse stack migration conflicts)
- cron: '0 22 * * 1'
workflow_dispatch:
# Allow manual triggering
inputs:
max_files:
description: 'Maximum number of files to process (for testing)'
required: false
default: ''
type: string
jobs:
mine-synapse-ids:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Use a personal access token to allow pushing changes
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Run PMC mining workflow
env:
SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }}
SYNAPSE_PAT: ${{secrets.SYNAPSE_PAT}}
run: |
# Determine max files parameter
MAX_FILES_ARG=""
if [ -n "${{ github.event.inputs.max_files }}" ]; then
MAX_FILES_ARG="--max-files ${{ github.event.inputs.max_files }}"
fi
# Run the workflow
synapse-miner -v workflow \
--synapse-pat "$SYNAPSE_PAT" \
--folder-id syn66046437 \
--table-id syn66047339 \
--tracking-file last_processed_pmc.json \
--output workflow_results.csv \
$MAX_FILES_ARG
- name: Commit and push tracking file
run: |
# Configure git
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# Add tracking file if it was updated
if [ -f last_processed_pmc.json ]; then
git add last_processed_pmc.json
# Check if there are changes to commit
if git diff --staged --quiet; then
echo "No changes to tracking file"
else
git commit -m "Update PMC processing tracking file [skip ci]"
git push
echo "Updated tracking file committed and pushed"
fi
else
echo "No tracking file found"
fi
- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: workflow-logs-and-results
path: |
workflow_results.csv
workflow_results.csv.*.csv
last_processed_pmc.json
retention-days: 30