1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- const DISPATCHES = [
- {
- workflow: 'js-build-and-lint.yml',
- pathFilterName: 'frontend',
- },
- {
- workflow: 'backend.yml',
- pathFilterName: 'backend_src',
- },
- ];
- module.exports = {
- dispatch: async ({github, context, core, fileChanges, mergeCommitSha}) => {
- core.startGroup('Dispatching request to getsentry.');
- const shouldSkip = {
- frontend: fileChanges.frontend_all !== 'true',
- backend_dependencies: fileChanges.backend_dependencies !== 'true',
- };
- await Promise.all(
- DISPATCHES.map(({workflow, pathFilterName}) => {
- const inputs = {
- pull_request_number: `${context.payload.pull_request.number}`,
- skip: `${shouldSkip[pathFilterName]}`,
-
- '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();
- },
- };
|