-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep CITATION and citation.cff
in sync with DESCRIPTION
#467
Conversation
So this PR would add a CITATION.cff file but it wouldn't help with updating the current CITATION file? As far as I know there is no way currently to use a cff to update a CITATION file so it gets picked up properly by R? This action would also ideally update the README as the citation is printed there. |
I don't see the citation info in the README 👀. |
It's the other way around. If you want to keep # Code copied from citation()
author <- meta$`Authors@R`
if (length(author)) {
aar <- .read_authors_at_R_field(author)
author <- Filter(function(e) {
!(is.null(e$given) && is.null(e$family)) && !is.na(match("aut",
e$role))
}, aar)
}
bibentry(
bibtype = "Manual",
title = paste0(meta$Package, ": ", gsub("[[:space:]]+", " ", meta$Title)),
author = author,
year = format(meta$Date, "%Y"),
doi = "10.5281/zenodo.3957489"
) |
Thanks @Bisaloo 🙏🏻 |
Thanks, @Bisaloo. So, if I'm getting you right, a full-proof mechanism will involve adding the code snippet above to CITATION along with the workflow in this PR? |
If you want automatic sync of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think this can be merged once it is unlinked from the current issue it is linked to (as it doesn't address the core issue there). We should tag @Bisaloo comment from here there though as that provides insight into how to resolve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failures are legacy I think - rebasing to (or merging) main
should fix these.
d559cdf
to
f2ef139
Compare
.cff
GHA workflowcitation.cff
in sync with DESCRIPTION
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - have you tested it by running the new action manually on this branch?
Just realised that this isn't possible as it won't show up in the list of actions before merging. Second best is probably a test after merge. |
Flagging that you may want to integrate these changes since this repo has another workflow pushing files (render-readme): epiverse-trace/packagetemplate#92 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looks good to me. Thanks all and particularly @jamesmbaazam.
If anyone fancies doing something similar to epinowcast
that would be very much appreciated.
I'll do that. |
* Add citation.cff file and associated GHA workflow * Add NEWS item * Update contents of CITATION to sync with DESCRIPTION * Revised NEWS item * Fix a path * Pull before push
* Add citation.cff file and associated GHA workflow * Add NEWS item * Update contents of CITATION to sync with DESCRIPTION * Revised NEWS item * Fix a path * Pull before push
This PR closes #466 by adding a GitHub Actions workflow to auto-generate
citation.cff
whenever the citation fields in CITATION and DESCRIPTION change. It also adds code to keepinst/CITATION
andDESCRIPTION
in sync. Together, this will ensure that the package citation information is always up to date.