Skip to content

Merge branch 'test-cite-workflow' of github.com:jurra/pymurtree into … #15

Merge branch 'test-cite-workflow' of github.com:jurra/pymurtree into …

Merge branch 'test-cite-workflow' of github.com:jurra/pymurtree into … #15

Workflow file for this run

on:
push:
branches: [ develop, main, test-cite-workflow ]
jobs:
gen-citation:
# if_merged:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cff-from-621
- name: Generate citation based on pyproject.toml
run: |
cff-from-621
# Check that citation file has been generated
if [ ! -f *.cff ]; then
echo "No citation file generated"
exit 1
fi
- name: Commit and push changes
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
# Check if there are changes to be committed
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit"
else
git config --local user.email "{{ github.actor }}@users.noreply.github.com"
git config --local user.name "GitHub Action"
git add *.cff
git commit -m "Auto commit after successful merge"
git push
fi