Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21bda5437d | ||
|
|
a7a727a739 | ||
|
|
0b057da401 |
No files matched your search
@@ -1,30 +0,0 @@
|
||||
# Configuration for Repo Lockdown - https://github.com/dessant/repo-lockdown
|
||||
|
||||
name: 'Repo Lockdown'
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: opened
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
action:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/repo-lockdown@v2
|
||||
with:
|
||||
pr-comment: |
|
||||
Thank you for your interest in the QEMU project.
|
||||
|
||||
This repository is a read-only mirror of the project's repostories hosted
|
||||
on https://gitlab.com/qemu-project/qemu.git.
|
||||
The project does not process merge requests filed on GitHub.
|
||||
|
||||
QEMU welcomes contributions of code (either fixing bugs or adding new
|
||||
functionality). However, we get a lot of patches, and so we have some
|
||||
guidelines about contributing on the project website:
|
||||
https://www.qemu.org/contribute/
|
||||
lock-pr: true
|
||||
close-pr: true
|
||||
@@ -0,0 +1,91 @@
|
||||
name: Merge upstream updates
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '11 2 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: merge-upstream-intel-vm-suspend
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
if: github.repository == 'reims-go/qemu-reims-vgpu'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Merge upstream into the maintenance branch
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TARGET_BRANCH: intel-vm-suspend
|
||||
UPSTREAM_REPO: steelbrain/qemu-reims-vgpu
|
||||
UPSTREAM_BRANCH: steelbrain/reims-vgpu-rebase-2
|
||||
GIT_AUTHOR_NAME: YXC0915
|
||||
GIT_AUTHOR_EMAIL: 62410385+yxc0915@users.noreply.github.com
|
||||
GIT_COMMITTER_NAME: 'github-actions[bot]'
|
||||
GIT_COMMITTER_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'
|
||||
GIT_TERMINAL_PROMPT: '0'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
summary() {
|
||||
printf '%s\n' "$1" | tee -a "$GITHUB_STEP_SUMMARY"
|
||||
}
|
||||
|
||||
# Check ancestry on GitHub first so routine polls do not fetch QEMU history.
|
||||
target_ref=${TARGET_BRANCH//\//%2F}
|
||||
upstream_ref=${UPSTREAM_BRANCH//\//%2F}
|
||||
status=$(gh api "repos/$GITHUB_REPOSITORY/compare/$target_ref...${UPSTREAM_REPO%%/*}:$upstream_ref?per_page=1" --jq .status)
|
||||
case "$status" in
|
||||
identical|behind)
|
||||
summary "$TARGET_BRANCH already contains $UPSTREAM_REPO:$UPSTREAM_BRANCH."
|
||||
exit 0
|
||||
;;
|
||||
ahead|diverged) ;;
|
||||
*)
|
||||
echo "::error::Unexpected upstream comparison status: $status"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
git init --bare --quiet "$RUNNER_TEMP/upstream-sync.git"
|
||||
cd "$RUNNER_TEMP/upstream-sync.git"
|
||||
git remote add origin "https://github.com/$GITHUB_REPOSITORY.git"
|
||||
git remote add upstream "https://github.com/$UPSTREAM_REPO.git"
|
||||
git fetch --no-tags --refmap= origin "refs/heads/$TARGET_BRANCH:refs/remotes/origin/target"
|
||||
git fetch --no-tags --refmap= upstream "refs/heads/$UPSTREAM_BRANCH:refs/remotes/upstream/source"
|
||||
target=$(git rev-parse refs/remotes/origin/target)
|
||||
source=$(git rev-parse refs/remotes/upstream/source)
|
||||
|
||||
# Recheck ancestry using the exact commits that were fetched.
|
||||
if git merge-base --is-ancestor "$source" "$target"; then
|
||||
summary "$TARGET_BRANCH already contains upstream commit $source."
|
||||
exit 0
|
||||
fi
|
||||
if git merge-base --is-ancestor "$target" "$source"; then
|
||||
merged=$source
|
||||
elif tree=$(git merge-tree --write-tree "$target" "$source"); then
|
||||
merged=$(git commit-tree "$tree" -p "$target" -p "$source" \
|
||||
-m "Merge $UPSTREAM_REPO:$UPSTREAM_BRANCH into $TARGET_BRANCH")
|
||||
else
|
||||
result=$?
|
||||
printf '%s\n' "$tree" | sed 's/^/ /'
|
||||
if [[ "$result" != 1 ]]; then
|
||||
exit "$result"
|
||||
fi
|
||||
echo "::warning::Upstream merge has conflicts. The maintenance branch was not updated."
|
||||
summary "Skipped merging $source into $TARGET_BRANCH at $target because of merge conflicts. See the job log."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# A normal push rejects a competing branch update and leaves its work intact.
|
||||
auth=$(printf 'x-access-token:%s' "$GH_TOKEN" | base64 -w0)
|
||||
echo "::add-mask::$auth"
|
||||
git -c "http.https://github.com/.extraheader=AUTHORIZATION: basic $auth" \
|
||||
push origin "$merged:refs/heads/$TARGET_BRANCH"
|
||||
summary "Merged upstream commit $source into $TARGET_BRANCH at $merged."
|
||||
Reference in new issue
Block a user