Unverified Commit d72a0355 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

[ci]: remove PR creation from deploy test workflow (#93400)

We're not planning to re-enable this workflow, and instead are handling
the upgrade PRs from within the applications themselves.

This removes them since they are currently failing.
parent f476c5f8
......@@ -310,161 +310,3 @@ jobs:
--commit-sha "${{ github.sha }}"
env:
ADAPTER_TEST_RESULTS_SECRET: ${{ secrets.ADAPTER_TEST_RESULTS_SECRET }}
create-draft-prs:
name: Immediately open draft prs
needs: setup
if: ${{ github.repository_owner == 'vercel' && github.event_name == 'release' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repo: front
workflow_id: cron-update-next.yml
- repo: v0
workflow_id: update-next.yaml
steps:
- name: Check token
run: gh auth status
# This sometimes fails for unknown reasons.
# Ignoring failures for now to check if a failure actually blocks subsequent steps
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
- uses: actions/github-script@v7
name: Check if target workflow is enabled
id: check-workflow-enabled
with:
retries: 3
retry-exempt-status-codes: 400,401,403,404,422
github-token: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
result-encoding: string
script: |
const response = await github.request(
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}",
{
owner: "vercel",
repo: "${{ matrix.repo }}",
workflow_id: "${{ matrix.workflow_id }}",
}
);
const isEnabled = response.data.state === 'active';
console.info(`Target workflow state: ${response.data.state}`);
console.info(`Target workflow enabled: ${isEnabled}`);
return isEnabled ? 'true' : 'false';
- uses: actions/github-script@v7
name: Create draft PR for vercel/${{ matrix.repo }}
id: create-draft-pr
if: steps.check-workflow-enabled.outputs.result == 'true'
with:
retries: 3
retry-exempt-status-codes: 400,401,404
github-token: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
result-encoding: string
script: |
const inputs = {
version: "${{ needs.setup.outputs.next-version }}"
};
await github.request(
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
{
owner: "vercel",
repo: "${{ matrix.repo }}",
workflow_id: "${{ matrix.workflow_id }}",
ref: "main",
inputs: inputs,
}
);
console.info(`Draft PR creation triggered for ${{ matrix.repo }}`);
console.info(`Workflow will create draft PR by default`);
update-prs:
name: Update prs as ready for review
needs: [test-deploy-turbopack, test-deploy-webpack, create-draft-prs]
if: ${{ (needs.test-deploy-webpack.result == 'success' || needs.test-deploy-webpack.result == 'skipped') && needs.test-deploy-turbopack.result == 'success' && github.repository_owner == 'vercel' && github.event_name == 'release' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repo: front
workflow_id: cron-update-next.yml
workflow_url: https://github.com/vercel/front/actions/workflows/cron-update-next.yml?query=event%3Aworkflow_dispatch
- repo: v0
workflow_id: update-next.yaml
workflow_url: https://github.com/vercel/v0/actions/workflows/update-next.yaml?query=event%3Aworkflow_dispatch
steps:
- name: Check token
run: gh auth status
# This sometimes fails for unknown reasons.
# Ignoring failures for now to check if a failure actually blocks subsequent steps
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
- uses: actions/github-script@v7
name: Check if target workflow is enabled
id: check-workflow-enabled
with:
retries: 3
retry-exempt-status-codes: 400,401,404
github-token: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
result-encoding: string
script: |
try {
const response = await github.request(
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}",
{
owner: "vercel",
repo: "${{ matrix.repo }}",
workflow_id: "${{ matrix.workflow_id }}",
}
);
const isEnabled = response.data.state === 'active';
console.info(`Target workflow state: ${response.data.state}`);
console.info(`Target workflow enabled: ${isEnabled}`);
return isEnabled ? 'true' : 'false';
} catch (error) {
console.error('Error checking workflow status:', error);
return 'false';
}
- uses: actions/github-script@v7
name: Mark PR ready for review in vercel/${{ matrix.repo }}
id: mark-pr-ready
if: steps.check-workflow-enabled.outputs.result == 'true'
with:
retries: 3
retry-exempt-status-codes: 400,401,404
# Default github token cannot dispatch events to the remote repo, it should be
# a PAT with Actions write access (https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event)
github-token: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
# Note `workflow_id` and `inputs` are contract between vercel/${{ matrix.repo }},
# if these need to be changed both side should be updated accordingly.
script: |
const inputs = {
version: "${{ needs.setup.outputs.next-version }}",
'make-ready-for-review': 'true',
force: 'true'
};
await github.request(
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
{
owner: "vercel",
repo: "${{ matrix.repo }}",
workflow_id: "${{ matrix.workflow_id }}",
ref: "main",
inputs: inputs,
}
);
console.info("Tests passed - PR will be marked ready for review");
console.info(
"PR ready-for-review triggered in ${{ matrix.workflow_url }}"
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment