Skip to content
Draft
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
36 changes: 36 additions & 0 deletions .github/workflows/create-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Creates a pull request using a reusable workflow when specific conditions are met.
name: Create a pull request

on:
workflow_run:
workflows:
- 'Newfold Prepare Release'
types:
- 'completed'
branches:
- 'main'

# Cancels all previous workflow runs for pull requests that have not completed.
Comment on lines +4 to +13

Check failure

Code scanning / zizmor

use of fundamentally insecure workflow trigger Error

use of fundamentally insecure workflow trigger
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_run' && format( '{0}-{1}', github.event.workflow_run.head_branch, github.event.workflow_run.head_repository.name ) || github.sha }}

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}

jobs:
# This runs the reusable workflow for creating a pull request.
prep-release:
name: Create pull request
permissions:
contents: write
pull-requests: write
uses: newfold-labs/workflows/.github/workflows/reusable-create-pull-request.yml@main
with:
base-branch: ${{ github.event.workflow_run.inputs.target-branch }}
head-branch: ${{ github.event.workflow_run.inputs.source-branch }}
Comment on lines +32 to +33

Copilot AI Jul 18, 2025

Copy link

Choose a reason for hiding this comment

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

The workflow_run event context doesn't have an 'inputs' property. For workflow_run events, you should use '${{ github.event.workflow_run.head_branch }}' for the head branch and specify the base branch directly or use workflow_run conclusion data.

Suggested change
base-branch: ${{ github.event.workflow_run.inputs.target-branch }}
head-branch: ${{ github.event.workflow_run.inputs.source-branch }}
base-branch: main
head-branch: ${{ github.event.workflow_run.head_branch }}

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +33

Copilot AI Jul 18, 2025

Copy link

Choose a reason for hiding this comment

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

The workflow_run event context doesn't have an 'inputs' property. Use '${{ github.event.workflow_run.head_branch }}' to get the branch that triggered the workflow run.

Suggested change
base-branch: ${{ github.event.workflow_run.inputs.target-branch }}
head-branch: ${{ github.event.workflow_run.inputs.source-branch }}
base-branch: main
head-branch: ${{ github.event.workflow_run.head_branch }}

Copilot uses AI. Check for mistakes.
workflow-id: ${{ github.event.workflow_run.id }}
pr-title: 'Need to figure out how to pass this along.'

Copilot AI Jul 18, 2025

Copy link

Choose a reason for hiding this comment

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

The hardcoded placeholder title should be replaced with a dynamic value or proper configuration. Consider using workflow_run metadata like '${{ github.event.workflow_run.display_title }}' or constructing a meaningful title.

Suggested change
pr-title: 'Need to figure out how to pass this along.'
pr-title: ${{ github.event.workflow_run.display_title }}

Copilot uses AI. Check for mistakes.
pr-labels: '' # Not sure how to pass this along yet either.
Loading