diff --git a/.github/workflows/citation.yaml b/.github/workflows/citation.yaml index 1cd21077..5acfb862 100644 --- a/.github/workflows/citation.yaml +++ b/.github/workflows/citation.yaml @@ -11,26 +11,20 @@ jobs: sync: runs-on: ubuntu-latest steps: - - #- name: Checkout repo - # uses: actions/checkout@v2 - # with: - # repository: bioexcel/biobb_analysis - # path: ./ + - name: Checkout repo + uses: actions/checkout@v2 + with: + repository: bioexcel/biobb_analysis + path: ./ - name: Download file using wget run: wget -O ./CITATION.cff https://raw.githubusercontent.com/bioexcel/biobb/master/CITATION.cff - name: Check if file has changed - run: pwd - - - name: Check if file has changed - run: ls -la ../ + run: ls -la ./ - #- 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 commit -m 'Sync citation file from biobb repo' - # git push + - name: Commit and push changes if file has changed + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git diff --exit-code CITATION.cff || (git add CITATION.cff && git commit -m "Updated CITATION.cff" && git push) \ No newline at end of file