fix #134 - include base_ref and head_ref in github context from the event json
This commit is contained in:
@@ -140,3 +140,40 @@ func TestRunEventSecrets(t *testing.T) {
|
||||
err = runner.NewPlanExecutor(plan)(ctx)
|
||||
assert.NilError(t, err, workflowPath)
|
||||
}
|
||||
|
||||
func TestRunEventPullRequest(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
|
||||
log.SetLevel(log.DebugLevel)
|
||||
ctx := context.Background()
|
||||
|
||||
platforms := map[string]string{
|
||||
"ubuntu-latest": "node:12.6-buster-slim",
|
||||
}
|
||||
|
||||
workflowPath := "pull-request"
|
||||
eventName := "pull_request"
|
||||
|
||||
workdir, err := filepath.Abs("testdata")
|
||||
assert.NilError(t, err, workflowPath)
|
||||
|
||||
runnerConfig := &Config{
|
||||
Workdir: workdir,
|
||||
EventName: eventName,
|
||||
EventPath: filepath.Join(workdir, workflowPath, "event.json"),
|
||||
Platforms: platforms,
|
||||
ReuseContainers: false,
|
||||
}
|
||||
runner, err := New(runnerConfig)
|
||||
assert.NilError(t, err, workflowPath)
|
||||
|
||||
planner, err := model.NewWorkflowPlanner(fmt.Sprintf("testdata/%s", workflowPath))
|
||||
assert.NilError(t, err, workflowPath)
|
||||
|
||||
plan := planner.PlanEvent(eventName)
|
||||
|
||||
err = runner.NewPlanExecutor(plan)(ctx)
|
||||
assert.NilError(t, err, workflowPath)
|
||||
}
|
||||
|
Reference in New Issue
Block a user