Skip to content

feat: auto-update CITATION.cff on version tags, bump to v2.1.5#115

Merged
eurunuela merged 2 commits intoME-ICA:masterfrom
eurunuela:feat/auto-update-citation
Mar 3, 2026
Merged

feat: auto-update CITATION.cff on version tags, bump to v2.1.5#115
eurunuela merged 2 commits intoME-ICA:masterfrom
eurunuela:feat/auto-update-citation

Conversation

@eurunuela
Copy link
Collaborator

Summary

  • Add .github/workflows/update-citation.yml — triggers on v* tags and automatically updates version: and date-released: in CITATION.cff, then commits back to master
  • Manually update CITATION.cff from v1.0.17 (2021-12-17) to v2.1.5 (2026-02-25) to reflect the current release

Motivation

CITATION.cff was stuck at v1.0.17 while the project is now at v2.1.5. The new workflow ensures it stays in sync with every future release automatically.

How the workflow works

  1. Triggered by any v* tag push
  2. Checks out master with write permissions
  3. Strips the v prefix from the tag name to get the bare version
  4. Uses sed to update version: and date-released: in-place
  5. Commits and pushes if there are changes (idempotent — skips commit if already up to date)

Test plan

  • Merge this PR
  • Push a new version tag (e.g. v2.1.6) and verify CITATION.cff is committed to master with updated fields

🤖 Generated with Claude Code

- Add workflow that triggers on v* tags and updates version and
  date-released fields in CITATION.cff, then commits back to master
- Manually update CITATION.cff from v1.0.17 (2021-12-17) to v2.1.5
  (2026-02-25) to reflect the current release

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 3, 2026 17:21
@netlify
Copy link

netlify bot commented Mar 3, 2026

Deploy Preview for rica-fmri ready!

Name Link
🔨 Latest commit fbbe66b
🔍 Latest deploy log https://app.netlify.com/projects/rica-fmri/deploys/69a71aae5987990008f36e0b
😎 Deploy Preview https://deploy-preview-115--rica-fmri.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automation to keep CITATION.cff release metadata in sync with version tags, and updates the current citation metadata to the latest release.

Changes:

  • Add a GitHub Actions workflow that runs on v* tag pushes and updates version: / date-released: in CITATION.cff, committing back to the default branch.
  • Update CITATION.cff from v1.0.17 (2021-12-17) to v2.1.5 (2026-02-25).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
CITATION.cff Bumps citation metadata to v2.1.5 with updated release date.
.github/workflows/update-citation.yml Introduces tag-triggered automation to rewrite and commit citation metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +18
- uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.GITHUB_TOKEN }}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow is hard-coded to check out and push to master. This repo’s other workflows support both master and main, so this may update the wrong branch (or fail) if the default branch is main. Consider targeting the repository default branch (e.g., ${{ github.event.repository.default_branch }}) for both actions/checkout.ref and the subsequent push destination.

Copilot uses AI. Check for mistakes.
- name: Update version and date in CITATION.cff
run: |
VERSION="${GITHUB_REF_NAME#v}"
DATE="$(date -u +%Y-%m-%d)"
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DATE is set from the workflow run time (date -u), which can diverge from the actual release/tag date if a tag is created or pushed later. To keep date-released deterministic and aligned with the tagged commit, consider deriving it from the tag’s target commit timestamp (e.g., via git show -s --format=%cs $GITHUB_SHA).

Suggested change
DATE="$(date -u +%Y-%m-%d)"
DATE="$(git show -s --format=%cs "$GITHUB_SHA")"

Copilot uses AI. Check for mistakes.
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CITATION.cff
git diff --cached --quiet || git commit -m "chore: update CITATION.cff to ${GITHUB_REF_NAME}"
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit/push back to the default branch will trigger the existing build.yml workflow (it runs on branch pushes). That means a tag push will likely cause two CI runs (one for the tag, one for the follow-up branch commit). If that’s unintended, consider adding a CI-skip marker to the commit message or adjusting the build workflow to ignore CITATION-only commits / github-actions[bot] commits.

Suggested change
git diff --cached --quiet || git commit -m "chore: update CITATION.cff to ${GITHUB_REF_NAME}"
git diff --cached --quiet || git commit -m "chore: update CITATION.cff to ${GITHUB_REF_NAME} [skip ci]"

Copilot uses AI. Check for mistakes.
- Use default_branch instead of hardcoded 'master' for checkout and push
- Use git commit timestamp (git show --format=%cs) for date-released
  instead of workflow run time, keeping it aligned with the tagged commit
- Add [skip ci] to commit message to avoid a spurious CI run on the
  follow-up branch push

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Collaborator Author

@eurunuela eurunuela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three points addressed in the follow-up commit:

  • Replaced hardcoded master with ${{ github.event.repository.default_branch }} for both checkout ref and push target.
  • Switched to git show -s --format=%cs "$GITHUB_SHA" for a deterministic commit-aligned date.
  • Added [skip ci] to the commit message to suppress the redundant CI run.

@eurunuela eurunuela merged commit 2bbfa1d into ME-ICA:master Mar 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants