removed citation automation as there is incompatibility with pyprojec… #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ develop, main, test-cite-workflow ] | |
pull_request: | |
types: | |
- closed | |
branches: [ develop, main ] | |
jobs: | |
gen-citation: | |
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 |