Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions .github/actions/sync/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ runs:
git config --global user.name "github-actions"
git config --global user.email "[email protected]"

###Sync steps for kernel repository###
- name: Sync with latest changes
if: inputs.topic_repo == 'qualcomm-linux/kernel'
shell: bash
Expand All @@ -44,50 +45,41 @@ runs:
git fetch origin ${{ inputs.base_branch }}
git merge origin/${{ inputs.base_branch }}

- name: Clone repositories
if: inputs.topic_repo == 'qualcomm-linux/kernel-topics'
- name: Fetch PR
if: inputs.topic_repo == 'qualcomm-linux/kernel'
shell: bash
run: |
git clone https://github.com/qualcomm-linux/kernel.git
git clone https://github.com/qualcomm-linux/automerge.git
git checkout ${{ inputs.base_branch }}
git fetch https://github.com/qualcomm-linux/kernel.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}}
git merge pr-${{ inputs.pr_number }} --no-commit || echo "Merge already applied or fast-forwarded"
if ! git diff --cached --quiet; then
git commit -m "Merged PR #${{ inputs.pr_number }}"
else
echo "Nothing to commit. PR may already be merged or fast-forwarded."
fi

- name: Create merge configuration
###Sync steps for kernel-topics repository###
- name: Clone repositories
if: inputs.topic_repo == 'qualcomm-linux/kernel-topics'
shell: bash
run: |
TOPIC_BRANCH=${{ inputs.base_branch }}
TOPIC_REPO=${{ inputs.topic_repo }}
cat <<EOF > merge.conf
baseline https://github.com/qualcomm-linux/kernel.git qcom-next
topic https://github.com/$TOPIC_REPO.git $TOPIC_BRANCH
EOF
echo "File 'merge.conf' created successfully."
git clone https://github.com/qualcomm-linux/kernel.git
git clone https://github.com/qualcomm-linux/automerge.git
git clone https://github.com/qualcomm-linux/kernel-config.git

- name: Run auto merge
- name: Run automerge
if: inputs.topic_repo == 'qualcomm-linux/kernel-topics'
shell: bash
run: |
sed -i 's/kernel.git/kernel-topics.git/g' kernel-config/qcom-next.conf
sed -i 's/qcom-next-staging/baseline/g' kernel-config/qcom-next.conf
cd kernel
../automerge/ci-merge -f ../merge.conf -t head -n
../automerge/ci-merge -f ../kernel-config/qcom-next.conf -t head -i qcom-next -c https://github.com/sgaud-quic/cache -n

- name: Fetch PR
if: inputs.topic_repo == 'qualcomm-linux/kernel-topics'
shell: bash
run: |
cd kernel
git fetch https://github.com/${{inputs.topic_repo}}.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}}
git merge pr-${{inputs.pr_number}} --no-commit
git commit -m "Merged PR ${{inputs.pr_number}}"

- name: Fetch PR
if: inputs.topic_repo == 'qualcomm-linux/kernel'
shell: bash
run: |
git checkout ${{ inputs.base_branch }}
git fetch https://github.com/qualcomm-linux/kernel.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}}
git merge pr-${{ inputs.pr_number }} --no-commit || echo "Merge already applied or fast-forwarded"
if ! git diff --cached --quiet; then
git commit -m "Merged PR #${{ inputs.pr_number }}"
else
echo "Nothing to commit. PR may already be merged or fast-forwarded."
fi