-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
104 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Create Auto-merged Pull Request | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
command: | ||
description: The command to create the actual changeset | ||
required: true | ||
type: string | ||
|
||
# shivammathur/setup-php | ||
php-version: | ||
description: Setup PHP version. | ||
default: '8.4' | ||
type: string | ||
|
||
# ramsey/composer-install | ||
dependency-versions: | ||
description: The version of dependencies to prefer (`lowest`, `highest`, or `locked`). | ||
default: locked | ||
type: string | ||
composer-options: | ||
description: Additional options to pass to Composer (e.g. `--ignore-platform-reqs`). | ||
default: --optimize-autoloader | ||
type: string | ||
|
||
# create-auto-merged-pull-request | ||
add-paths: | ||
description: > | ||
A comma or newline-separated list of file paths to commit. | ||
Paths should follow git's pathspec syntax. | ||
Defaults to adding all new and modified files. | ||
type: string | ||
branch: | ||
description: The pull request branch name. | ||
required: true | ||
type: string | ||
delete-branch: | ||
description: > | ||
Delete the `branch` if it doesn't have an active pull request associated with it. | ||
default: true | ||
type: boolean | ||
base: | ||
description: > | ||
The pull request base branch. | ||
Defaults to the branch checked out in the workflow. | ||
default: ${{ github.ref_name }} | ||
type: string | ||
title: | ||
description: The title of the pull request. | ||
type: string | ||
body: | ||
description: The body of the pull request. | ||
type: string | ||
labels: | ||
description: A comma or newline separated list of labels. | ||
type: string | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
create-auto-merged-pull-request-php: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.php-version }} | ||
coverage: none | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: ramsey/composer-install@v3 | ||
with: | ||
dependency-versions: ${{ inputs.dependency-versions }} | ||
composer-options: ${{ inputs.composer-options }} | ||
|
||
- run: ${{ inputs.command }} | ||
|
||
- name: Compute temporary variables | ||
id: tmp-vars | ||
shell: bash | ||
run: | | ||
echo "title=:robot: \`$COMMAND\`" >> "$GITHUB_OUTPUT" | ||
env: | ||
COMMAND: ${{ inputs.command }} | ||
|
||
- uses: typisttech/.github/.github/workflows/create-auto-merged-pull-request@app-token | ||
with: | ||
add-paths: ${{ inputs.add-paths }} | ||
branch: ${{ inputs.branch }} | ||
delete-branch: ${{ inputs.delete-branch }} | ||
base: ${{ inputs.base }} | ||
title: ${{ inputs.title || steps.tmp-vars.outputs.title }} | ||
labels: ${{ inputs.labels }} |