From 4dcb10a533be36ccb27fdf94228ff8f55ee4ff49 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 21:29:23 +0000 Subject: [PATCH] Add update-codemeta job to prepare-release workflow (fixes #76) Agent-Logs-Url: https://github.com/openMetadataInitiative/openMINDS_MATLAB/sessions/79868e2c-4418-4fa8-8095-cb9e77eaaa9e Co-authored-by: ehennestad <17237719+ehennestad@users.noreply.github.com> --- .github/workflows/prepare-release.yml | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 2acb43d7..f86bb8cc 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -23,3 +23,45 @@ jobs: tools_directory: tools secrets: DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + + update-codemeta: + name: Update codemeta.json + needs: prepare-release + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.DEPLOY_KEY }} + ref: main + + - name: Determine version string + id: version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "tag=v${{ inputs.version }}" >> $GITHUB_OUTPUT + else + echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT + fi + + - name: Set up MATLAB + uses: matlab-actions/setup-matlab@v2 + + - name: Update codemeta.json + uses: matlab-actions/run-command@v2 + with: + command: addpath(genpath("tools")); updateCodeMetaFile("${{ steps.version.outputs.tag }}") + + - name: Commit and push changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add codemeta.json + if git diff --cached --quiet; then + echo "No changes to commit" + else + git commit -m "Update codemeta.json for ${{ steps.version.outputs.tag }}" + git push + fi