Skip to content

Commit 434416e

Browse files
committed
fix(ci): update workflow pr creation
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 80043eb commit 434416e

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

.github/workflows/update-workflow.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,15 @@ jobs:
6363
fi
6464
fi
6565
66-
- name: Commit and push changes
67-
run: |
68-
git add ${{ inputs.file_path }}
69-
git diff --cached --quiet || git commit -sm "chore: update ${{ inputs.file_path }} from master branch"
70-
71-
# Create a new branch for the PR
72-
file_path_safe=$(echo "${{ inputs.file_path }}" | sed 's|/|-|g')
73-
pr_branch="workflow/update-${file_path_safe}-${{ matrix.target_branch }}"
74-
git checkout -b "$pr_branch"
75-
git push origin "$pr_branch"
76-
77-
# Create a pull request
78-
gh pr create --base ${{ matrix.target_branch }} --head "$pr_branch" --title "chore: update ${{ inputs.file_path }} from master branch" --body "Automated update of ${{ inputs.file_path }} from master branch"
79-
env:
80-
GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
66+
- name: Create Pull Request
67+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
68+
with:
69+
token: ${{ secrets.COMMAND_BOT_PAT }}
70+
commit-message: 'chore: update ${{ inputs.file_path }} from master branch'
71+
committer: GitHub <noreply@github.com>
72+
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
73+
signoff: true
74+
branch: 'workflow/update-${{ inputs.file_path }}-${{ matrix.target_branch }}'
75+
base: ${{ matrix.target_branch }}
76+
title: 'chore: update ${{ inputs.file_path }} from master branch'
77+
body: 'Automated update of ${{ inputs.file_path }} from master branch'

0 commit comments

Comments
 (0)