Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New approach to implement action to export the .csv #608

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/update-dalia-csv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update DALIA CSV on Resource Change

on:
pull_request:
paths:
- 'resources/nfdi4bioimage.yml'

jobs:
update-dalia-csv:
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v2

# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

# Install dependencies
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install nbconvert transformers torch
sudo apt-get install -y poppler-utils

# Execute the Notebook to export CSV in DALIA format
- name: Execute Jupyter Notebook
run: |
jupyter nbconvert --execute --inplace scripts/Export_to_DALIA.ipynb

# Commit and push changes if any file was updated
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

git add .
git diff --staged --quiet || git commit -m "Auto-update CSV after modifying nfdi4bioimage.yml"

git pull --rebase origin ${{ github.head_ref }}

# Authenticate and push
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.head_ref }}


Loading