-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add a GitHub Actions workflow for automatic validation of the citation metadata file (CITATION.CFF
)
#44062
Conversation
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.
- The
persist-credentials: false
option should be passed toactions/checkout@v2
- The
GITHUB_TOKEN
in this workflow should not have any write permissions. This can be accomplished by setting the appropriate top-levelpermissions
key.
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. |
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.
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 |
.github/workflows/cffconvert.yml
Outdated
on: | ||
push: | ||
paths: | ||
- CITATION.cff |
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.
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.cff
file was modified, and this is a pull request, and the base (target) branch of the pull request is eithermaster
orrelease-*
, then run the workflow. - If the
CITATION.cff
file was modified, and this is a push to eithermaster
orrelease-*
, 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
)
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.
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. |
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.
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.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. 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