Use payload schema for events

This commit is contained in:
Beth Brennan
2023-01-06 12:16:55 -05:00
parent a2ee3041df
commit b68ac91a69
55 changed files with 8379 additions and 4 deletions
@@ -1130,6 +1130,39 @@ jobs:
}
]);
});
it("validates event payload", async () => {
const input = `
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo \${{ github.event.forced }}
- run: echo \${{ github.event.schedule }}
`;
const result = await validate(createDocument("wf.yaml", input));
expect(result).toEqual([
{
message: "Context access might be invalid: schedule",
range: {
end: {
character: 46,
line: 8
},
start: {
character: 18,
line: 8
}
},
severity: DiagnosticSeverity.Warning
}
]);
});
it("validates event inputs", async () => {
const input = `
on: