mirror of
https://github.com/RetroDECK/components-template.git
synced 2024-11-21 19:05:39 +00:00
Never do an automatic merge
This commit is contained in:
parent
1b8e1ac05b
commit
437b595042
17
.github/workflows/pr_from_upstream.yml
vendored
17
.github/workflows/pr_from_upstream.yml
vendored
|
@ -54,19 +54,26 @@ jobs:
|
|||
git merge --strategy-option theirs --no-edit FETCH_HEAD
|
||||
}
|
||||
|
||||
- name: Push changes if there are updates
|
||||
- name: Create a new branch for PR if changes detected
|
||||
id: create_branch
|
||||
env:
|
||||
BRANCH_NAME: "sync-${{ github.run_id }}" # Temporary branch name for the PR
|
||||
run: |
|
||||
if [ "$(git status --porcelain)" ]; then
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
git push origin "$BRANCH_NAME"
|
||||
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
|
||||
else
|
||||
echo "No changes to push."
|
||||
echo "No changes detected. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
- name: Push changes to new branch
|
||||
if: success()
|
||||
run: |
|
||||
git push origin "$BRANCH_NAME"
|
||||
|
||||
- name: Create Pull Request
|
||||
if: success() && steps.push.outputs.branch != '' # Only run if there are changes
|
||||
if: success()
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
token: ${{ steps.generate-rekku-token.outputs.token || secrets.GITHUB_TOKEN }}
|
||||
|
@ -112,4 +119,4 @@ jobs:
|
|||
```bash
|
||||
git push origin ${{ env.BRANCH_NAME }}
|
||||
```
|
||||
base: $TARGET_BRANCH
|
||||
base: $TARGET_BRANCH
|
Loading…
Reference in a new issue