@krx3d/tizentube2 1.15.820 → 1.15.840

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ concurrency:
21
21
  env:
22
22
  UPSTREAM_REPO: https://github.com/reisxd/TizenTube.git
23
23
  UPSTREAM_BRANCH: main
24
+ UPSTREAM_BRANCH_REF: upstream/main
24
25
  SYNC_BRANCH: sync/upstream
25
26
 
26
27
  jobs:
@@ -59,15 +60,20 @@ jobs:
59
60
  if: steps.check.outputs.count != '0'
60
61
  run: |
61
62
  set -euo pipefail
63
+ BASE_SHA=$(git rev-parse origin/main)
62
64
  git checkout -B "$SYNC_BRANCH" origin/main
63
65
 
66
+ # --no-commit so the CI-exclusion below lands in the same commit
67
+ # whether or not the merge conflicted, rather than needing a second.
64
68
  CONFLICTS=""
65
- if ! git merge --no-edit "upstream/${UPSTREAM_BRANCH}"; then
69
+ git merge --no-commit --no-ff "$UPSTREAM_BRANCH_REF" || true
70
+
71
+ CONFLICTS=$(git diff --name-only --diff-filter=U || true)
72
+ if [ -n "$CONFLICTS" ]; then
66
73
  # Keep this fork's version of every conflicted file. The point of
67
74
  # the PR is to surface the change for review, not to guess at a
68
75
  # resolution — committing conflict markers would only produce a
69
76
  # branch that cannot build.
70
- CONFLICTS=$(git diff --name-only --diff-filter=U)
71
77
  echo "Conflicted files kept at fork version:"
72
78
  echo "$CONFLICTS"
73
79
  while IFS= read -r f; do
@@ -75,9 +81,30 @@ jobs:
75
81
  git checkout --ours -- "$f" 2>/dev/null || git rm -q -- "$f"
76
82
  git add -- "$f" 2>/dev/null || true
77
83
  done <<< "$CONFLICTS"
78
- git commit --no-edit
79
84
  fi
80
85
 
86
+ # CI is never synced from upstream, for two reasons. This fork runs
87
+ # its own workflows (npm publish, standalone .wgt build, this sync)
88
+ # which have no upstream counterpart, so importing theirs would be
89
+ # actively wrong. And GITHUB_TOKEN *cannot* push changes under
90
+ # .github/workflows at all — there is no "workflows" permission in
91
+ # the permissions: block, that scope exists only for PATs and GitHub
92
+ # Apps, so a push carrying one is rejected outright:
93
+ # refusing to allow a GitHub App to create or update workflow
94
+ # `.github/workflows/...` without `workflows` permission
95
+ # Restoring the directory to exactly origin/main covers both the
96
+ # modified and the newly-added case.
97
+ if git rev-parse --verify -q "${BASE_SHA}:.github/workflows" >/dev/null; then
98
+ git rm -rf --quiet --ignore-unmatch .github/workflows >/dev/null 2>&1 || true
99
+ git checkout "$BASE_SHA" -- .github/workflows
100
+ git add -A .github/workflows
101
+ echo "Restored .github/workflows to the fork's version"
102
+ fi
103
+
104
+ # A clean merge leaves everything staged but uncommitted because of
105
+ # --no-commit; a conflicted one is staged by the loop above.
106
+ git commit --no-edit || echo "Nothing to commit"
107
+
81
108
  {
82
109
  echo 'conflicts<<TT_EOF'
83
110
  echo "$CONFLICTS"