mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 04:22:01 +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'
|
||||
|
||||
jobs:
|
||||
create-pull-request:
|
||||
update-gatsby-fixtures:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -16,9 +16,12 @@ jobs:
|
||||
# 0 means fetch all commits so we can commit and push in the script below
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Enable corepack
|
||||
run: corepack enable pnpm
|
||||
- name: Create Pull Request
|
||||
- name: Update Gatsby Fixtures
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
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,
|
||||
repo,
|
||||
state: 'open',
|
||||
head: branch,
|
||||
head: `vercel:${branch}`,
|
||||
});
|
||||
|
||||
if (pulls.length === 0) {
|
||||
if (pulls.data.length === 0) {
|
||||
const pr = await github.rest.pulls.create({
|
||||
owner,
|
||||
repo,
|
||||
@@ -94,19 +94,6 @@ module.exports = async ({ github, context }) => {
|
||||
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({
|
||||
owner,
|
||||
repo,
|
||||
|
||||
Reference in New Issue
Block a user