feat: support signoff option#199
Conversation
|
@cole-h Thank you for the review and for spotting the error in the readme 😄 Can you approve it now? |
cole-h
left a comment
There was a problem hiding this comment.
I don't think this will do what you expect:
https://github.com/cole-h/update-flake-lock-test/blob/e3240e49453c6284996687e7e8d0a8b493b63d5e/.github/workflows/update.yml#L21
cole-h/update-flake-lock-test#42
Notice how there's no signoff line in this PR's commit:
This is likely because Nix itself is making the commit. If you want a signoff line, you'll need to manually change the commit message after it's been made, it seems.
|
Oh I see, I missed that!. What if we do remove the |
7ca7dcd to
8315a03
Compare
|
I played a bit with the action, and I finally make it work using create-pull-request action instead of using nix: https://github.com/andrea11/update-flake-lock-test/pull/3/commits What do you think about this approach? |
8d83460 to
fc9263c
Compare
|
Hi again @cole-h, I noticed that with my previous changes the flake update output went lost. I updated once more, to get something similar to what we had before: The output is not exactly the same as before, because I am using the output from nix flake update command rather and then delegate the commit to the github action create-pull-request. Let me know if you consider this blocking |
| path: pr_body.template | ||
| contents: ${{ inputs.pr-body }} | ||
| env: {} | ||
| - name: Set additional env variables (GIT_COMMIT_MESSAGE) |
There was a problem hiding this comment.
This is not needed anymore: the variable is set directly inside the index.ts as FLAKE_UPDATE_OUTPUT
| const execOptions: actionsExec.ExecOptions = { | ||
| cwd: this.pathToFlakeDir !== null ? this.pathToFlakeDir : undefined, | ||
| ignoreReturnCode: true, | ||
| outStream: new Writable({ |
There was a problem hiding this comment.
instead of this, I tried to use:
const {exitCode, stdout} = await actionsExec.getExecOutput("nix", nixCommandArgs, execOptions);but the stdout was empty
| actionsCore.setFailed(`non-zero exit code of ${exitCode} detected`); | ||
| } else { | ||
| actionsCore.info(`flake.lock file was successfully updated`); | ||
| if (output.length > COMMIT_MESSAGE_MAX_LENGTH) { |
There was a problem hiding this comment.
This is a safety net in the case the flake output is too huge (it can happen if we have plenty of outdated flakes as dependencies)
Signed-off-by: andrea11 <10788630+andrea11@users.noreply.github.com>
a68c73f to
853065c
Compare




Description
This PR add support for the signoff options supported by the Peter Evans's create-pull-request action
Checklist