Skip to content

Commit 63dc789

Browse files
committed
chore: sync winget-pkgs fork before submitting WinGet manifests
Pushing a release branch based on upstream/master to a stale fork is rejected when upstream changed workflow files and the PAT lacks the workflow scope (failed for v1.4.1, fixed by a manual gh repo sync). Sync the fork server-side first so the push introduces no workflow changes.
1 parent 34ae966 commit 63dc789

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/sync-manifests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ jobs:
119119
120120
# Clone the fork (created once via: gh repo fork microsoft/winget-pkgs)
121121
WINGET_FORK="${WINGET_FORK:-apgiorgi/winget-pkgs}"
122+
123+
# Sync the fork with upstream before branching: the release branch is
124+
# based on upstream/master, and pushing upstream's workflow-file
125+
# changes to a stale fork is rejected when the PAT lacks the
126+
# `workflow` scope. The merge-upstream API (what `gh repo sync`
127+
# calls) is server-side and exempt from that scope check. --force
128+
# keeps the fork's master a mirror; release branches are unaffected.
129+
GH_TOKEN="${WINGET_GH_PAT}" gh repo sync "${WINGET_FORK}" \
130+
--source microsoft/winget-pkgs --force
131+
122132
git clone --depth 1 \
123133
"https://x-access-token:${WINGET_GH_PAT}@github.com/${WINGET_FORK}.git" \
124134
/tmp/winget-pkgs

0 commit comments

Comments
 (0)