123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- const DISPATCHES = [
- {
- workflow: 'js-build-and-lint.yml',
- pathFilterName: 'frontend_all',
- },
- {
- workflow: 'backend.yml',
- pathFilterName: 'backend_all',
- },
- ];
- module.exports = {
- dispatch: async ({github, context, core, fileChanges, mergeCommitSha}) => {
- core.startGroup('Dispatching request to getsentry.');
- await Promise.all(
- DISPATCHES.map(({workflow, pathFilterName}) => {
- const inputs = {
- pull_request_number: `${context.payload.pull_request.number}`,
- skip: `${fileChanges[pathFilterName] !== 'true'}`,
-
- 'sentry-sha': mergeCommitSha,
-
- 'sentry-pr-sha': context.payload.pull_request.head.sha,
- };
- core.info(
- `Sending dispatch for '${workflow}':\n${JSON.stringify(inputs, null, 2)}`
- );
- return github.rest.actions.createWorkflowDispatch({
- owner: 'getsentry',
- repo: 'getsentry',
- workflow_id: workflow,
- ref: 'master',
- inputs,
- });
- })
- );
- core.endGroup();
- },
- };
|