-
Notifications
You must be signed in to change notification settings - Fork 56
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 GH action for determining the commit range #287
Conversation
@MatthijsBurgh, does my implementation look correct? |
04c3e43
to
79befb8
Compare
Also @MatthijsBurgh, are you aware of a good way to have automated tests for GitHub actions? Do we need a separate dummy repository to run it in? We could of course have unit tests for the |
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.
LGTM
Thanks @yoursvivek. I haven't had the time to actually try this out for real though. Definitely need to do that. |
I'm trying this out in akaihola/ipython_pytest#4. Got this error:
|
5a5c149
to
8dd88ac
Compare
The action implementation is from https://github.com/tue-robotics/tue-env/blob/a37ee191d4a3b73f354d43b1623831040b58a90b/ci/commit-range/action.yml Copyright (c) 2022, Eindhoven University of Technology - CST Robotics Group Licensed under the BSD 3-Clause License. See `.github/actions/commit-range/LICENSE.md`
8dd88ac
to
4912986
Compare
I fixed the above problem in I was also able to fix this problem which occurred in akaihola/ipython-pytest#4: Run akaihola/darker@gh-action-revisions
with:
src: .
options: --check --diff
version: 1.4.0
Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile'
under '/home/runner/work/ipython_pytest/ipython_pytest/.github/actions/commit-range'.
Did you forget to run actions/checkout before running your local action? The solution is to refer to the But one question remains: how to ensure Updating version numbers is ok, since there are already several occurrences of the version number and I'm certainly going to automate updating of those everywhere (in a way similar to what |
0f9b7b0
to
362d20a
Compare
@MatthijsBurgh this is now released in 1.4.1. Could you check whether everything went correctly in akaihola/ipython_pytest#4? In build #5 (triggered by push), the commit range is empty: env:
commit_list: [
{
"author": {
"email": "[email protected]",
"name": "Antti Kaihola",
"username": "akaihola"
},
"committer": {
"email": "[email protected]",
"name": "Antti Kaihola",
"username": "akaihola"
},
"distinct": true,
"id": "d8af955248f594aa0e8c63424459ba46d177f939",
"message": "Update Darker Action to version 1.4.1",
"timestamp": "2022-02-18T00:20:13+02:00",
"tree_id": "fab60c74fd14f1602e15ba07136b333aa4173f87",
"url": "https://github.com/akaihola/ipython_pytest/commit/d8af955248f594aa0e8c63424459ba46d177f939"
}
]
COMMIT_RANGE = Is this correct? |
Not this probably not correct. The default value of |
I don't know what you are referring to.
I am running this in https://github.com/MatthijsBurgh/epydoc. The |
I have no experience on that. I don't automatically test my GH actions. Depending on the type of test it could be in this repo or a separate one. |
Thanks for working on the fix in the action_debug branch. Looks good and clean. By suitability of the description to the documentation I meant that we should probably explain what the default commit range is if the user doesn't override the
As for automated tests, I'm not super enthusiastic right now to dive into researching how to do it, so maybe we'll just do manual testing for now and hope we won't need to do a lot of changes to the Action. |
Add a
revision:
parameter for the GitHub Action. If omitted, defaults to comparingHEAD
toThe
commit-range
action implementation is from tue-robotics/tue-env/ci/commit-range/action.ymlCopyright (c) 2022, Eindhoven University of Technology - CST Robotics Group
Licensed under the BSD 3-Clause License.
See
.github/actions/commit-range/LICENSE.md
Fixes #260