Skip to content

Commit 6fe1d7b

Browse files
padmaiaalii
authored andcommitted
Add trigger for v0 sync workflow (vercel#81645)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
1 parent 3b1c3bf commit 6fe1d7b

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

.github/workflows/test_e2e_deploy_release.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,20 @@ jobs:
8989
DD_ENV=ci npx @datadog/[email protected] junit upload --tags test.type:deploy --service nextjs ./test/test-junit-report
9090
fi
9191
92-
front-sync:
92+
sync-repositories:
9393
needs: test-deploy
9494
if: ${{ always() && github.repository_owner == 'vercel' && github.event_name == 'release' }}
9595
runs-on: ubuntu-latest
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
include:
100+
- repo: front
101+
workflow_id: cron-update-next.yml
102+
workflow_url: https://github.com/vercel/front/actions/workflows/cron-update-next.yml?query=event%3Aworkflow_dispatch
103+
- repo: v0
104+
workflow_id: update-next.yml
105+
workflow_url: https://github.com/vercel/v0/actions/workflows/update-next.yml?query=event%3Aworkflow_dispatch
96106
steps:
97107
- uses: actions/checkout@v4
98108
- id: nextPackageInfo
@@ -128,8 +138,8 @@ jobs:
128138
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}",
129139
{
130140
owner: "vercel",
131-
repo: "front",
132-
workflow_id: "cron-update-next.yml",
141+
repo: "${{ matrix.repo }}",
142+
workflow_id: "${{ matrix.workflow_id }}",
133143
}
134144
);
135145
@@ -143,16 +153,16 @@ jobs:
143153
return 'false';
144154
}
145155
- uses: actions/github-script@v7
146-
name: Trigger vercel/front sync
147-
id: trigger-front-sync
156+
name: Trigger vercel/${{ matrix.repo }} sync
157+
id: trigger-sync
148158
if: steps.check-workflow-enabled.outputs.result == 'true'
149159
with:
150160
retries: 3
151161
retry-exempt-status-codes: 400,401,404
152162
# Default github token cannot dispatch events to the remote repo, it should be
153163
# a PAT with Actions write access (https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event)
154164
github-token: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
155-
# Note `workflow_id` and `inputs` are contract between vercel/front,
165+
# Note `workflow_id` and `inputs` are contract between vercel/${{ matrix.repo }},
156166
# if these need to be changed both side should be updated accordingly.
157167
script: |
158168
const immediatelyClose = '${{ steps.test-result.outputs.immediately-close }}';
@@ -168,19 +178,19 @@ jobs:
168178
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
169179
{
170180
owner: "vercel",
171-
repo: "front",
172-
workflow_id: "cron-update-next.yml",
181+
repo: "${{ matrix.repo }}",
182+
workflow_id: "${{ matrix.workflow_id }}",
173183
ref: "main",
174184
inputs: inputs,
175185
}
176186
);
177187
// Ideally we'd include a URL to this specific sync.
178188
// However, creating a workflow_dispatch event does not produce an ID: https://github.com/orgs/community/discussions/9752
179189
console.info(
180-
"Sync started in https://github.com/vercel/front/actions/workflows/cron-update-next.yml?query=event%3Aworkflow_dispatch"
190+
"Sync started in ${{ matrix.workflow_url }}"
181191
);
182192
console.info(
183-
"This may not start a new sync if one is already in progress. Check the logs of the cron-update-next Workflow run."
193+
"This may not start a new sync if one is already in progress. Check the logs of the workflow run."
184194
);
185195
if (immediatelyClose === 'true') {
186196
console.info(

0 commit comments

Comments
 (0)