From b2d9e41029282ced3735ac404e3ac73f7ce8b2c6 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 9 Jan 2024 16:13:58 -0500 Subject: [PATCH] ci: run on PRs & use pre-commit hooks --- .github/workflows/update-citation-cff.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-citation-cff.yaml b/.github/workflows/update-citation-cff.yaml index 4cdc07a..d479e04 100644 --- a/.github/workflows/update-citation-cff.yaml +++ b/.github/workflows/update-citation-cff.yaml @@ -7,9 +7,10 @@ on: release: types: [published] - push: + pull_request: branches: [master, main] paths: + - .github/workflows/update-citation-cff.yaml - DESCRIPTION - inst/CITATION workflow_dispatch: @@ -45,11 +46,14 @@ jobs: cff_write(keys = mykeys) shell: Rscript {0} - - - name: Commit results + - name: Configure git run: | git config --local user.name "github-actions[bot]" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git add CITATION.cff + - uses: pre-commit/action@v3.0.0 + - name: Commit results + run: | + git add CITATION.cff git commit -m 'chore: update CITATION.cff' || echo "No changes to commit" git push origin || echo "No changes to commit"