From 96b9a14e283221f9f77fbb4172ed13d9ad25b002 Mon Sep 17 00:00:00 2001 From: M57 <41645758+Hy4ri@users.noreply.github.com> Date: Tue, 23 Jun 2026 12:36:57 +0300 Subject: [PATCH] Add workflow to label PRs with merge conflicts (#342) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(#65): request POST_NOTIFICATIONS runtime permission on Android 13+ On API 33+ the manifest declaration alone is not enough — the app must request POST_NOTIFICATIONS via ActivityResultContracts.RequestPermission at runtime before it can show any notification, including the foreground service notification from ChatNotificationService. - Added rememberLauncherForActivityResult for POST_NOTIFICATIONS - Added LaunchedEffect(Unit) that fires the permission request on first composition when running on API 33+ and permission is not yet granted - The next lifecycle event (ON_STOP → NotificationHelper.start) picks up the permission if granted * fix: add missing import android.os.Build for POST_NOTIFICATIONS permission check * fix: add missing import for rememberLauncherForActivityResult (androidx.activity.compose) * Add GitHub workflow to check PR for linked issue * Add workflow to label PRs with merge conflicts * Remove pr-issue-check.yml, keep only merge-conflict-label workflow * Remove issue-tag.yml, keep only merge-conflict-label workflow in PR --------- Co-authored-by: M57 Co-authored-by: Hermes Agent Co-authored-by: Hermes Agent --- .github/workflows/merge-conflict-label.yml | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/merge-conflict-label.yml diff --git a/.github/workflows/merge-conflict-label.yml b/.github/workflows/merge-conflict-label.yml new file mode 100644 index 00000000..9b988a81 --- /dev/null +++ b/.github/workflows/merge-conflict-label.yml @@ -0,0 +1,56 @@ +name: Label PR merge conflicts + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + label-conflict: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: read + steps: + - name: Get PR data and label conflicts + uses: actions/github-script@v7 + with: + script: | + const pr = context.payload.pull_request; + const prNumber = pr.number; + const repo = context.repo; + + // Fetch PR details to get mergeable_state + const { data: prData } = await github.rest.pulls.get({ + ...repo, + pull_number: prNumber + }); + + const mergeableState = prData.mergeable_state; // clean, dirty, blocked, unstable + const hasConflict = mergeableState === 'dirty'; + + const labelName = 'merge-conflict'; + + // Get current labels + const { data: labels } = await github.rest.issues.listLabelsOnIssue({ + ...repo, + issue_number: prNumber + }); + const hasLabel = labels.some(l => l.name === labelName); + + if (hasConflict && !hasLabel) { + console.log(`PR #${prNumber} has merge conflicts. Adding label '${labelName}'.`); + await github.rest.issues.addLabels({ + ...repo, + issue_number: prNumber, + labels: [labelName] + }); + } else if (!hasConflict && hasLabel) { + console.log(`PR #${prNumber} no longer has merge conflicts. Removing label '${labelName}'.`); + await github.rest.issues.removeLabel({ + ...repo, + issue_number: prNumber, + name: labelName + }); + } else { + console.log(`PR #${prNumber}: conflict=${hasConflict}, label=${hasLabel}. No change needed.`); + } \ No newline at end of file