diff --git a/.github/workflows/create-pull-request.yml b/.github/workflows/create-pull-request.yml new file mode 100644 index 000000000..f011fd178 --- /dev/null +++ b/.github/workflows/create-pull-request.yml @@ -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 }} + workflow-id: ${{ github.event.workflow_run.id }} + pr-title: 'Need to figure out how to pass this along.' + pr-labels: '' # Not sure how to pass this along yet either.