Skip to content

Commit 72d39df

Browse files
castrojoCopilot
andcommitted
fix(ci): push nightly sha256 updates via PR instead of direct push
main is protected by a merge queue; GITHUB_TOKEN cannot push directly. Create a dated branch, open a PR, and enable auto-merge so it lands once CI passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a09a047 commit 72d39df

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/update-mozilla-nightly.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
pull-requests: write
1011

1112
jobs:
1213
update-sha256s:
@@ -63,11 +64,10 @@ jobs:
6364
echo "changed=false" >> "$GITHUB_OUTPUT"
6465
fi
6566
66-
- name: Commit and push if changed
67+
- name: Commit and open PR if changed
6768
id: commit
6869
env:
69-
FF_CHANGED: ${{ steps.ff-x86_64.outputs.changed == 'true' || steps.ff-aarch64.outputs.changed == 'true' }}
70-
TB_CHANGED: ${{ steps.tb-x86_64.outputs.changed == 'true' }}
70+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7171
run: |
7272
git config user.name "github-actions[bot]"
7373
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
@@ -91,11 +91,20 @@ jobs:
9191
echo "ff_changed=$FF_MANIFEST_CHANGED" >> "$GITHUB_OUTPUT"
9292
echo "tb_changed=$TB_MANIFEST_CHANGED" >> "$GITHUB_OUTPUT"
9393
94+
BRANCH="chore/nightly-sha256-$(date +%Y%m%d)"
95+
git checkout -b "$BRANCH"
9496
git add flatpaks/firefox-nightly/manifest.yaml flatpaks/thunderbird-nightly/manifest.yaml
9597
printf 'chore(nightly): update Mozilla nightly sha256s\n\nAuto-refresh sha256 for firefox-nightly and thunderbird-nightly.\nMozilla rebuilds nightly at the same URL daily; version string stays\n150.0a1 so Renovate cannot track this.\n\nCo-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>\n' > /tmp/nightly-commit-msg.txt
9698
git commit -F /tmp/nightly-commit-msg.txt
97-
git pull --rebase
98-
git push
99+
git push origin "$BRANCH"
100+
101+
# Open PR and enable auto-merge so it lands once CI passes
102+
gh pr create \
103+
--title "chore(nightly): update Mozilla nightly sha256s $(date +%Y-%m-%d)" \
104+
--body "Auto-refresh sha256 for firefox-nightly and thunderbird-nightly. Mozilla rebuilds nightly at the same URL daily; version string stays 150.0a1 so Renovate cannot track this." \
105+
--base main \
106+
--head "$BRANCH" || true
107+
gh pr merge "$BRANCH" --auto --squash || true
99108
100109
- name: Trigger firefox-nightly build
101110
if: steps.commit.outputs.ff_changed == 'true'

0 commit comments

Comments
 (0)