Skip to content

- test Action

- test Action #3

Workflow file for this run

name: excel2csv
on: [push]
jobs:
run:
name: excel2csv
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'pyqalloy-contribute/requirements.txt'
- name: Install Dependencies
run: |
python -m pip install -r pyqalloy-contribute/requirements.txt
- name: Run excel2csv
run: |
python pyqalloy-contribute/pyqalloy-contribute/excel2csv.py .
- name: Calculate diff
id: diff
run: |
git add *.csv
DIFF_COUNT=$(git diff --cached --numstat | awk '{sum += $1 + $2} END {print sum}')
echo "diff_count=$DIFF_COUNT" >> $GITHUB_OUTPUT
- name: Extract changing DOIs and add them to a set
id: dois
run: |
DOIS=$(git diff --cached -U0 | grep '^[+-]' | grep -v '^+++\|^---' | awk -F',' '{print "`" $NF "`"}' | sort -u | tr '\n' ' ')
echo "dois=$DOIS" >> $GITHUB_OUTPUT
- name: Commit changes with Add & Commit
uses: EndBug/add-and-commit@v9
with:
message: '(auto) Data Tracking Action changed ${{ steps.diff.outputs.diff_count }} lines / data points [Changed DOIs: ${{ steps.diff.outputs.dois }}]'
add: '*.csv'