Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions .github/workflows/needs-reply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,26 @@ jobs:
# Keep this job capped at 10 minutes; never raise it unless explicitly asked.
timeout-minutes: 10
steps:
- name: Check if issues are enabled
id: check-issues
env:
GH_TOKEN: ${{ github.token }}
run: |
HAS_ISSUES=$(gh api "repos/${GITHUB_REPOSITORY}" --jq '.has_issues' 2>/dev/null || echo "false")
echo "has_issues=${HAS_ISSUES}" >> "$GITHUB_OUTPUT"

- name: Skip when issues are disabled
if: steps.check-issues.outputs.has_issues != 'true'
run: echo "Issues are disabled on ${GITHUB_REPOSITORY}; skipping needs-reply workflow."

- name: Setup Node.js
if: steps.check-issues.outputs.has_issues == 'true'
uses: actions/setup-node@v6
with:
node-version: 24.x

- name: Close old issues that need reply
if: steps.check-issues.outputs.has_issues == 'true'
uses: imhoffd/needs-reply@v2.0.0
with:
repo-token: ${{ secrets.BOT_TOKEN }}
Expand Down
42 changes: 32 additions & 10 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ jobs:
- name: Add upstream and fetch
run: |
git remote add upstream https://github.com/${{ env.UPSTREAM_REPO }}.git || true
git fetch upstream main
# checkout uses filter:blob:none, so origin is the promisor remote; upstream must be too
# or merge lazy-fetches ionic-team blobs from origin and fails with "not our ref"
git config remote.upstream.promisor true
git config remote.upstream.partialclonefilter blob:none
git fetch --no-filter upstream main
Comment thread
cursor[bot] marked this conversation as resolved.

- name: Check for new commits
id: check-commits
Expand Down Expand Up @@ -98,13 +102,20 @@ jobs:
git push origin main
echo "merge_success=true" >> $GITHUB_OUTPUT
else
echo "Merge conflict detected"
git merge --abort
echo "merge_success=false" >> $GITHUB_OUTPUT
if [ -f .git/MERGE_HEAD ]; then
echo "Merge conflict detected"
echo "merge_conflict=true" >> $GITHUB_OUTPUT
git merge --abort || git reset --hard origin/main
echo "merge_success=false" >> $GITHUB_OUTPUT
else
echo "Merge failed before MERGE_HEAD was created (missing git objects or other error)"
git merge --abort || true
exit 1
fi
fi

- name: Create PR for conflicts
if: steps.regular-merge.outputs.merge_success == 'false'
if: steps.regular-merge.outputs.merge_conflict == 'true'
env:
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
Expand Down Expand Up @@ -181,7 +192,11 @@ jobs:
- name: Add upstream and fetch
run: |
git remote add upstream https://github.com/${{ env.UPSTREAM_REPO }}.git || true
git fetch upstream main
# checkout uses filter:blob:none, so origin is the promisor remote; upstream must be too
# or merge lazy-fetches ionic-team blobs from origin and fails with "not our ref"
git config remote.upstream.promisor true
git config remote.upstream.partialclonefilter blob:none
git fetch --no-filter upstream main

- name: Check for new commits
id: check-commits
Expand Down Expand Up @@ -210,9 +225,16 @@ jobs:
echo "Merge successful!"
echo "merge_success=true" >> $GITHUB_OUTPUT
else
echo "Merge conflict detected"
git merge --abort
echo "merge_success=false" >> $GITHUB_OUTPUT
if [ -f .git/MERGE_HEAD ]; then
echo "Merge conflict detected"
echo "merge_conflict=true" >> $GITHUB_OUTPUT
git merge --abort || git reset --hard origin/plus
echo "merge_success=false" >> $GITHUB_OUTPUT
else
echo "Merge failed before MERGE_HEAD was created (missing git objects or other error)"
git merge --abort || true
exit 1
fi
fi

- name: Push if merge succeeded
Expand All @@ -222,7 +244,7 @@ jobs:
echo "Successfully pushed upstream changes to plus branch"

- name: Create PR for conflicts
if: steps.merge.outputs.merge_success == 'false'
if: steps.merge.outputs.merge_conflict == 'true'
env:
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
Expand Down
Loading