From 23a54293aae21e53af2348c7d9a03555408ec975 Mon Sep 17 00:00:00 2001 From: AAoritz Date: Mon, 5 Feb 2024 12:04:44 +0100 Subject: [PATCH] add codemeta workflow to update codemeta.json automatically from DESCRIPTION --- .github/workflows/codemeta-github-actions.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/codemeta-github-actions.yml diff --git a/.github/workflows/codemeta-github-actions.yml b/.github/workflows/codemeta-github-actions.yml new file mode 100644 index 0000000..518ac7a --- /dev/null +++ b/.github/workflows/codemeta-github-actions.yml @@ -0,0 +1,24 @@ +on: + push: + branches: master + paths: + - DESCRIPTION + - .github/workflows/main.yml + +name: Render codemeta +jobs: + render: + name: Render codemeta + runs-on: macOS-latest + if: "!contains(github.event.head_commit.message, 'cm-skip')" + steps: + - uses: actions/checkout@v1 + - uses: r-lib/actions/setup-r@v1 + - name: Install codemetar + run: Rscript -e 'install.packages("codemetar")' + - name: Render codemeta + run: Rscript -e 'codemetar::write_codemeta()' + - name: Commit results + run: | + git commit codemeta.json -m 'Re-build codemeta.json' || echo "No changes to commit" + git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit"