PR: troubleshooting the PR not being created

This commit is contained in:
XargonWan 2024-11-06 10:48:06 +09:00
parent 0d5712524f
commit 4c67d42c4c

View file

@ -45,6 +45,7 @@ jobs:
echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV
- name: Sync from Upstream Repository - name: Sync from Upstream Repository
continue-on-error: true
env: env:
BRANCH_NAME: "feat/update-from-upstream" BRANCH_NAME: "feat/update-from-upstream"
run: | run: |
@ -66,16 +67,10 @@ jobs:
git pull "${{ env.UPSTREAM_REPO }}" "${{ env.TARGET_BRANCH }}" git pull "${{ env.UPSTREAM_REPO }}" "${{ env.TARGET_BRANCH }}"
git diff git diff
# Check if there are any changes to commit echo "GIT_DIFF<<EOF" >> $GITHUB_ENV
if git diff --exit-code "origin/${{ env.TARGET_BRANCH }}"; then git diff >> $GITHUB_ENV
echo "No changes detected from upstream. Exiting without creating PR." echo "EOF" >> $GITHUB_ENV
echo "SKIP_PR=true" >> $GITHUB_ENV
else
git add -A
git commit -m "Updating ${{ github.event.repository.name }} with upstream changes"
echo "SKIP_PR=false" >> $GITHUB_ENV
fi
- name: Push changes to new branch - name: Push changes to new branch
if: success() && env.SKIP_PR == 'false' if: success() && env.SKIP_PR == 'false'
@ -94,6 +89,11 @@ jobs:
This PR merges the latest changes from the upstream repository: This PR merges the latest changes from the upstream repository:
- **Repository**: ${{ env.UPSTREAM_REPO }} - **Repository**: ${{ env.UPSTREAM_REPO }}
- **Branch**: ${{ env.TARGET_BRANCH }} - **Branch**: ${{ env.TARGET_BRANCH }}
## Differences
```
${{ env.GIT_DIFF }}
```
## Conflict Resolution Instructions ## Conflict Resolution Instructions
If there are conflicts in this PR, you can resolve them locally by following these steps: If there are conflicts in this PR, you can resolve them locally by following these steps: