Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Rebuild Javascript artifacts under the dist/ folder using a
# Dockerfile. After updating, don't forget to commit and push
# your changes.
.DEFAULT_GOAL := help

.PHONY: help
help: ## Show this help message.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'

.PHONY: dist-rebuild
dist-rebuild:
dist-rebuild: ## Rebuild JavaScript artifacts under dist/ using a Dockerfile. Commit and push the result afterwards.
docker build -t dist-builder .
docker run -u $(shell id -u):$(shell id -g) --rm -v $(shell pwd):/out dist-builder cp -rv /workdir/dist/. /out/dist
docker rmi -f dist-builder
docker rmi -f dist-builder
9 changes: 8 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,14 @@ function run() {
`;
process.env["MAYHEM_TOKEN"] = config.mayhemToken;
process.env["MAYHEM_URL"] = mayhemUrl;
process.env["MAYHEM_PROJECT"] = config.repo;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the new code does not use repo at all; is that intentional? I'm not sure what the repo field even is.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is github_workspace/github_project. there was an implied assumption that MAYHEM_PROJECT must be the same as the github combo.

// Match the --owner/--project flags passed to `mayhem run` above, so the
// wait/show/download subcommands (which only get --owner explicitly)
// resolve the same project instead of falling back to the GitHub repo.
// `project` may already be a fully-qualified "owner/project" reference,
// in which case `owner` shouldn't be prepended again.
process.env["MAYHEM_PROJECT"] = config.project.includes("/")
? config.project
: `${config.owner}/${config.project}`;
// Start fuzzing
const cliRunning = (0, exec_1.exec)("bash", ["-c", script], {
ignoreReturnCode: true,
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,14 @@ async function run(): Promise<void> {

process.env["MAYHEM_TOKEN"] = config.mayhemToken;
process.env["MAYHEM_URL"] = mayhemUrl;
process.env["MAYHEM_PROJECT"] = config.repo;
// Match the --owner/--project flags passed to `mayhem run` above, so the
// wait/show/download subcommands (which only get --owner explicitly)
// resolve the same project instead of falling back to the GitHub repo.
// `project` may already be a fully-qualified "owner/project" reference,
// in which case `owner` shouldn't be prepended again.
process.env["MAYHEM_PROJECT"] = config.project.includes("/")
? config.project
: `${config.owner}/${config.project}`;

// Start fuzzing
const cliRunning = exec("bash", ["-c", script], {
Expand Down
Loading