Add a GitHub Actions workflow for automatic validation of the citation metadata file (CITATION.CFF)#44062
Conversation
DilumAluthge
left a comment
There was a problem hiding this comment.
- The
persist-credentials: falseoption should be passed toactions/checkout@v2 - The
GITHUB_TOKENin this workflow should not have any write permissions. This can be accomplished by setting the appropriate top-levelpermissionskey.
|
Is it really necessary to have a workflow for a file which is more or less static? |
|
Agreed; I would prefer that we not add a workflow solely for this file. |
|
The way the workflow is written, it only gets triggered precisely when it is needed, so I think that addition is good |
|
Still, it will use some resources for every push to check if this file is in the diff, no? |
|
Hi @DilumAluthge, I have updated the workflow following your comment. Let me know if this is correct. |
DilumAluthge
left a comment
There was a problem hiding this comment.
You can further simplify the permissions section. If you specify the permissions you need (e.g. contents: read), and omit all other permissions, the omitted permissions should automatically be set to none, per the GitHub docs here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
b2d39a9 to
abd7f50
Compare
|
Thanks for the link, @DilumAluthge. I left only |
| on: | ||
| push: | ||
| paths: | ||
| - CITATION.cff |
There was a problem hiding this comment.
Currently, this workflow will not be triggered on pull requests that come from forks.
I think the behavior we want is this:
- If the
CITATION.cfffile was modified, and this is a pull request, and the base (target) branch of the pull request is eithermasterorrelease-*, then run the workflow. - If the
CITATION.cfffile was modified, and this is a push to eithermasterorrelease-*, then run the workflow. - Else, do not run the workflow.
I think that the following suggestion implements the above behavior, although it would be good for someone else to double-check.
| on: | |
| push: | |
| paths: | |
| - CITATION.cff | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'release-*' | |
| paths: | |
| - CITATION.cff | |
| pull_request: | |
| branches: | |
| - 'master' | |
| - 'release-*' | |
| paths: | |
| - CITATION.cff |
|
Hi @DilumAluthge, I have updated the workflow and I made some tests:
Let me know what you think. |
|
@abelsiqueira Would you mind making a small separate PR that just has the fix to the |
|
Hi @DilumAluthge, I have created #44236 with just the fix. After that PR is merged I will rebase this one. |
|
Now that #44236 has been merged, can you rebase and squash this PR? |
|
The question for triage is: should we add the GitHub Actions workflow file for validating this file? |
CITATION.CFF)
CITATION.CFF)CITATION.CFF)
DilumAluthge
left a comment
There was a problem hiding this comment.
From a technical point of view, this looks good. Let's see what triage thinks about the idea.
The requested changes have been made.
9ed8ab6 to
3ea7c7f
Compare
|
I have rebased and squashed the commits. |
|
Can you include a small no-op change to CITATION.cff in this PR, so that we can see this trigger and confirm it is working? |
I made a new no-op commit, but I don't expect it to run because the action is not part of the Alternatively, look at this earlier comment: #44062 (comment) specifically the cffbots#2 and cffbots#4 PRs. |
|
From triage: this is cool, but does not really seem warranted for an almost-never-changed file with a single citation in it. But I guess we might as well do it, no real cost? |
|
I enabled GitHub-provided and citation-file-format/cffconvert-github-action@2.0.0 actions. Can you push a rebase of this? |
5c0540e to
75cb753
Compare
|
I have rebased it. |
fingolfin
left a comment
There was a problem hiding this comment.
This looks good to me. I see no downsides: the action is only run when really needed. And yeah the file won't be changed often -- but rare events in my experience will be messed up precisely because they are rare and people forget what to watch out for. So I'd be for merging this.
Co-authored-by: Max Horn <max@quendi.de>
|
This branch is quite out of date, so getting CI green isn't worthwhile, but I'm going to merge this without a rebase because:
|
…n metadata file (`CITATION.CFF`) (JuliaLang#44062) Hello! We noticed that your `CITATION.cff` had a small issue and fixed it. In addition to the fix, this Pull Request automates validation of that file using the [cffconvert GitHub Action](https://github.com/marketplace/actions/cffconvert). That way, it's a little bit easier to be robust against future changes to the `CITATION.cff` file. BTW it's perfectly fine if you don't feel like accepting this Pull Request for whatever reason -- we just thought it might be helpful is all. We found your repository using a partially automated workflow; if you have any questions about that, feel free to create an issue over at https://github.com/cffbots/filtering/issues/ On behalf of the cffbots team, @abelsiqueira / @fdiblen / @jspaaks --------- Co-authored-by: Max Horn <max@quendi.de>
…n metadata file (`CITATION.CFF`) (JuliaLang#44062) Hello! We noticed that your `CITATION.cff` had a small issue and fixed it. In addition to the fix, this Pull Request automates validation of that file using the [cffconvert GitHub Action](https://github.com/marketplace/actions/cffconvert). That way, it's a little bit easier to be robust against future changes to the `CITATION.cff` file. BTW it's perfectly fine if you don't feel like accepting this Pull Request for whatever reason -- we just thought it might be helpful is all. We found your repository using a partially automated workflow; if you have any questions about that, feel free to create an issue over at https://github.com/cffbots/filtering/issues/ On behalf of the cffbots team, @abelsiqueira / @fdiblen / @jspaaks --------- Co-authored-by: Max Horn <max@quendi.de>
Hello!
We noticed that your
CITATION.cffhad a small issue and fixed it.In addition to the fix, this Pull Request automates validation of that file using the cffconvert GitHub Action. That way, it's a little bit easier to be robust against future changes to the
CITATION.cfffile.BTW it's perfectly fine if you don't feel like accepting this Pull Request for whatever reason -- we just thought it might be helpful is all.
We found your repository using a partially automated workflow; if you have any questions about that, feel free to create an issue over at https://github.com/cffbots/filtering/issues/
On behalf of the cffbots team,
@abelsiqueira / @fdiblen / @jspaaks