-
Notifications
You must be signed in to change notification settings - Fork 5
First pass at a reusable PR creation workflow #419
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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. | ||||||||||||||||||
| 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
|
||||||||||||||||||
| 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
AI
Jul 18, 2025
There was a problem hiding this comment.
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.
| 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
AI
Jul 18, 2025
There was a problem hiding this comment.
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.
| pr-title: 'Need to figure out how to pass this along.' | |
| pr-title: ${{ github.event.workflow_run.display_title }} |
Check failure
Code scanning / zizmor
use of fundamentally insecure workflow trigger Error