Skip to content

Commit 02f5345

Browse files
Merge pull request #10 from Tobias-Fischer/fix/bot-body-quoting
robostack-bot: pass the request text through the environment
2 parents 834fdc7 + 03ae7c3 commit 02f5345

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎.github/workflows/bot.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ jobs:
7373
jobs=$(echo "$jobs" | python3 -c 'import json,sys; print(json.dumps(json.load(sys.stdin) + [{"command":"update-conda-forge-pinning","distro":"","args":"","preview":False}]))')
7474
fi ;;
7575
workflow_dispatch) # only people with write access can dispatch
76-
jobs=$(pixi run -q rs parse-command --body "@robostack-bot $COMMAND $PACKAGES $DISTRO" --association OWNER) ;;
76+
jobs=$(ROBOSTACK_BOT_BODY="@robostack-bot $COMMAND $PACKAGES $DISTRO" ROBOSTACK_BOT_ASSOCIATION=OWNER pixi run -q rs parse-command) ;;
7777
*)
78-
jobs=$(pixi run -q rs parse-command --body "$BODY" --association "$ASSOCIATION") ;;
78+
jobs=$(ROBOSTACK_BOT_BODY="$BODY" ROBOSTACK_BOT_ASSOCIATION="$ASSOCIATION" pixi run -q rs parse-command) ;;
7979
esac
8080
echo "jobs=$jobs" | tee -a "$GITHUB_OUTPUT"
8181

‎tools/maintenance.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,9 @@ def main(command: str, argv: list[str], distro: str | None = None) -> int:
656656
parser.add_argument("name")
657657
parser.add_argument("--from", dest="source", required=True)
658658
if command == "parse-command":
659-
parser.add_argument("--body", required=True)
660-
parser.add_argument("--association", required=True)
659+
# the text comes from the environment: pixi's task shell would re-parse quotes in it
660+
parser.add_argument("--body", default=os.environ.get("ROBOSTACK_BOT_BODY", ""))
661+
parser.add_argument("--association", default=os.environ.get("ROBOSTACK_BOT_ASSOCIATION", ""))
661662
if command == "add-package":
662663
parser.add_argument("names", nargs="+", help="ROS packages, optionally followed by distributions")
663664
parser.add_argument("--preview", action="store_true", help="don't change files, only report")

0 commit comments

Comments
 (0)