Skip to content

Commit a2ecbc2

Browse files
authored
feat: update
1 parent c6c96c9 commit a2ecbc2

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Cre: https://github.com/orgs/community/discussions/153608#discussioncomment-12453674
2+
name: Sync Fork with Upstream
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Runs daily at midnight UTC
6+
workflow_dispatch: # Allows manual triggering
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Configure Git
13+
run: |
14+
git config --global user.email "994931+Zarloc@users.noreply.github.com"
15+
git config --global user.name "Zarloc"
16+
17+
- name: Checkout Forked Repository
18+
uses: actions/checkout@v6
19+
with:
20+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
21+
fetch-depth: 0
22+
23+
- name: Sync Upstream & Apply Patch
24+
run: |
25+
# 1. Fetch Upstream
26+
git remote add upstream https://github.com/netdata/netdata.git
27+
git fetch upstream master
28+
29+
# 2. Hard Reset: Wipe local history to match Upstream exactly
30+
# This removes yesterday's patch commit so we don't get conflicts
31+
git checkout master
32+
git reset --hard upstream/master
33+
34+
# 3. Apply the Hack (sed)
35+
echo "Applying auth bypass patch..."
36+
sed -i 's/return ((user & endpoint) == endpoint);/return true;/' src/web/api/http_auth.h
37+
38+
# 4. Add this file
39+
echo "${GITHUB_SYNC_UPSTREAM}" > .github/workflow/sync-upstream.yml
40+
41+
# 5. Commit the changes
42+
git add src/web/api/http_auth.h
43+
git add .github/workflow/sync-upstream.yml
44+
git commit -m "feat: bypass Netdata Cloud sign-in which is required to access dashboard features"
45+
46+
# 6. Force Push
47+
# We force push because we rewrote history (replaced yesterday's commit with today's)
48+
git push origin master --force

0 commit comments

Comments
 (0)