Skip to content

Commit 8f9f9da

Browse files
authored
Update Pull from Upstream and Merge PRs.yml
1 parent 6e539bf commit 8f9f9da

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

.github/workflows/Pull from Upstream and Merge PRs.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ env:
2323
# This list is automatically updated - merged PRs are removed after successful runs
2424
# To add new PRs: edit this line and add the PR numbers to the list
2525
DEFAULT_PR_NUMBERS: '6346,6356,6376,6676,6735,6803,6824,6831,6860,6904,6912,6919,6928,6939,6965,6969'
26+
# Token for authentication
27+
GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN || github.token }}
2628

2729
jobs:
2830
pull-and-merge:
@@ -33,7 +35,18 @@ jobs:
3335
uses: actions/checkout@v4
3436
with:
3537
fetch-depth: 0
36-
token: ${{ secrets.PRS || github.token }} # Use PAT if available
38+
token: ${{ env.GH_TOKEN }}
39+
persist-credentials: true
40+
41+
- name: Verify authentication
42+
run: |
43+
# Check if PAT_TOKEN is available
44+
if [ -n "${{ secrets.PAT_TOKEN }}" ]; then
45+
echo "✓ PAT_TOKEN is configured"
46+
else
47+
echo "⚠ PAT_TOKEN not found, using default GITHUB_TOKEN"
48+
echo "Note: Without PAT_TOKEN, the workflow cannot update itself"
49+
fi
3750
3851
- name: Configure Git
3952
run: |
@@ -44,14 +57,27 @@ jobs:
4457
4558
- name: Add upstream remote
4659
run: |
60+
# Add upstream without authentication (public repo)
4761
git remote add upstream https://github.com/jellyfin/jellyfin-web.git || \
4862
git remote set-url upstream https://github.com/jellyfin/jellyfin-web.git
63+
64+
# Fix origin URL to include authentication token
65+
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git
4966
5067
- name: Fetch all remotes
5168
run: |
69+
echo "Current remotes:"
70+
git remote -v
71+
72+
echo "Fetching from origin..."
5273
git fetch origin
74+
75+
echo "Pulling from origin master..."
5376
git pull origin master
77+
78+
echo "Fetching from upstream..."
5479
git fetch upstream
80+
5581
echo "Fetched latest changes from all remotes"
5682
5783
- name: Merge upstream

0 commit comments

Comments
 (0)