Skip to content

Commit a1998a1

Browse files
committed
Update workflow to support PAT for fork writes
1 parent 725ffa7 commit a1998a1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/publish-conan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
repository: d-led/conan-center-index
3737
path: conan-center-index
38-
token: ${{ secrets.GITHUB_TOKEN }}
38+
token: ${{ secrets.CONAN_INDEX_PAT || secrets.GITHUB_TOKEN }}
3939
persist-credentials: true
4040

4141
- name: Setup conan-center-index upstream
@@ -52,7 +52,7 @@ jobs:
5252
CONAN_INDEX_FORK: d-led/conan-center-index
5353
CONAN_INDEX_UPSTREAM: conan-io/conan-center-index
5454
CONAN_INDEX_DIR: ${{ github.workspace }}/conan-center-index
55-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
GITHUB_TOKEN: ${{ secrets.CONAN_INDEX_PAT || secrets.GITHUB_TOKEN }}
5656
run: |
5757
./scripts/publish-conan-version.sh "${{ steps.version.outputs.version }}"
5858

docs/development.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ The package is published to [Conan Center](https://conan.io/center) via pull req
165165
1. Fork https://github.com/conan-io/conan-center-index
166166
2. Clone your fork locally
167167
3. Set upstream remote: `git remote add upstream https://github.com/conan-io/conan-center-index.git`
168+
4. **Create a GitHub Personal Access Token (PAT)** with `repo` scope:
169+
- Go to https://github.com/settings/tokens
170+
- Generate a new token (classic) with `repo` scope
171+
- Add it as a repository secret named `CONAN_INDEX_PAT` in your influxdb-cpp-rest repository
172+
- Go to Settings → Secrets and variables → Actions → New repository secret
173+
- Name: `CONAN_INDEX_PAT`
174+
- Value: your PAT token
175+
176+
**Note:** The workflow will use `GITHUB_TOKEN` if `CONAN_INDEX_PAT` is not set, but `GITHUB_TOKEN` cannot push to forks. A PAT is required for automated publishing.
168177

169178
### Publishing a New Version
170179

0 commit comments

Comments
 (0)