Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update chrome PR creation workflow to add to firewatch board #27821

Merged
merged 3 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/update-browser-versions.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Update Browser Versions
on:
workflow_dispatch:

schedule:
- cron: '0 8 * * *' # every day at 8am UTC (3/4am EST/EDT)
jobs:
Expand Down Expand Up @@ -104,6 +106,7 @@ jobs:
})
# Update available and a PR doesn't already exist
- name: Create Pull Request
id: create-pr
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' }}
uses: actions/github-script@v6
with:
Expand All @@ -117,4 +120,5 @@ jobs:
branchName: '${{ steps.check-branch.outputs.branch_name }}',
description: '${{ steps.get-versions.outputs.description }}',
body: 'This PR was auto-generated to update the version(s) of Chrome for driver tests',
addToProjectBoard: true,
})
26 changes: 25 additions & 1 deletion scripts/github-actions/create-pull-request.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const createPullRequest = async ({ context, github, baseBranch, branchName, description, body, reviewers }) => {
const createPullRequest = async ({ context, github, baseBranch, branchName, description, body, reviewers, addToProjectBoard }) => {
const { data: { number } } = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -17,6 +17,30 @@ const createPullRequest = async ({ context, github, baseBranch, branchName, desc
reviewers,
})
}

if (addToProjectBoard) {
const addToProjectBoardQuery = `
mutation ($project_id: ID!, $item_id: ID!) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be curious to know why this line isn't handling these PRs. Does that workflow not get called when this PR is created?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I can't figure it out for the life of me, so I just was explicit about adding it.

addProjectV2ItemById(input: {contentId: $item_id, projectId: $project_id}) {
clientMutationId
item {
id
}
}
}`

const addToProjectBoardQueryVars = {
project_id: 9,
item_id: number,
}

const addToProjectBoard = await github.graphql(
addToProjectBoardQuery,
addToProjectBoardQueryVars
)

}

}

module.exports = {
Expand Down
Loading