profile
viewpoint

Ask questions`command-working-directory` is not obeyed

Example:

[
        {
                "id": "runscript",
                "execute-command": "/path/to/script.sh",
                "command-working-directory": "/tmp",
                "pass-environment-to-command": [
                        {
                                "source": "payload",
                                "name": "env1",
                                "envname": "ENV1"
                        },
                        {
                                "source": "payload",
                                "name": "env2",
                                "envname": "ENV2"
                        }
        }
]

script.sh

#!/bin/sh
pwd

In my log, I see the following

[webhook] 2020/09/24 16:09:40 [d92f25] executing /path/to/script.sh (/path/to/script.sh) with arguments ["/path/to/script.sh"] and environment [ENV1=a ENV2=b] using /path/to as cwd
/path/to

This is with the latest version of webhook: 2.7.0

adnanh/webhook

Answer questions jf

sorry, my bad! I had been editing the wrong hooks.json. Turns out that there is no problem with command-working-directory. 👍

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List