mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 21:07:46 +00:00
Fix update gatsby fixture cron job (#9725)
This PR fixes the gatsby fixture update script to correctly create pull requests after it updates the fixtures.
This commit is contained in:
@@ -8,7 +8,7 @@ on:
|
|||||||
- cron: '0 0 * * 0'
|
- cron: '0 0 * * 0'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-pull-request:
|
update-gatsby-fixtures:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -16,9 +16,12 @@ jobs:
|
|||||||
# 0 means fetch all commits so we can commit and push in the script below
|
# 0 means fetch all commits so we can commit and push in the script below
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
- name: Enable corepack
|
- name: Enable corepack
|
||||||
run: corepack enable pnpm
|
run: corepack enable pnpm
|
||||||
- name: Create Pull Request
|
- name: Update Gatsby Fixtures
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|||||||
17
utils/update-gatsby-fixtures.js
vendored
17
utils/update-gatsby-fixtures.js
vendored
@@ -81,10 +81,10 @@ module.exports = async ({ github, context }) => {
|
|||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
state: 'open',
|
state: 'open',
|
||||||
head: branch,
|
head: `vercel:${branch}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (pulls.length === 0) {
|
if (pulls.data.length === 0) {
|
||||||
const pr = await github.rest.pulls.create({
|
const pr = await github.rest.pulls.create({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
@@ -94,19 +94,6 @@ module.exports = async ({ github, context }) => {
|
|||||||
body: 'Automatically generated PR to update Gatsby fixture versions in `@vercel/static-build`',
|
body: 'Automatically generated PR to update Gatsby fixture versions in `@vercel/static-build`',
|
||||||
});
|
});
|
||||||
|
|
||||||
await github.rest.pulls.requestReviewers({
|
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
pull_number: pr.data.number,
|
|
||||||
reviewers: [
|
|
||||||
'Ethan-Arrowood',
|
|
||||||
'styfle',
|
|
||||||
'TooTallNate',
|
|
||||||
'EndangeredMassa',
|
|
||||||
'cb1kenobi',
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
await github.rest.issues.addLabels({
|
await github.rest.issues.addLabels({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
|
|||||||
Reference in New Issue
Block a user