Deprecation warnings when deploying to CFP from GitLab CI/CD

I typically deploy to Cloudflare Pages from GitHub Actions, but am currently doing so from GitLab CI/CD. The CFP-relevant parts of my .gitlab-ci.yml script (https://github.com/brycewray/hugo-site/blob/main/.gitlab-ci.yml) are:
- npm install -g wrangler --unsafe-perm=true
- wrangler pages deploy ./public --project-name=$PROJECT_NAME --branch "main"
- npm install -g wrangler --unsafe-perm=true
- wrangler pages deploy ./public --project-name=$PROJECT_NAME --branch "main"
I get a successful deploy, but receive these warnings (which I don’t get when using GitHub Actions to deploy):
[WARNING] Using "CF_API_KEY" environment variable. This is deprecated. Please use "CLOUDFLARE_API_KEY", instead.
[WARNING] Using "CF_EMAIL" environment variable. This is deprecated. Please use "CLOUDFLARE_EMAIL", instead.
[WARNING] Using "CF_API_KEY" environment variable. This is deprecated. Please use "CLOUDFLARE_API_KEY", instead.
[WARNING] Using "CF_EMAIL" environment variable. This is deprecated. Please use "CLOUDFLARE_EMAIL", instead.
These items — I’ll call them security vars — all refer to existing “Secrets” I have in GitHub and CI/CD variables I have in GitLab, and I assigned the names back in the wrangler 1.x days. From searching the Discord about such warnings, I get the impression that it’s the names themselves that are the problem. So is the solution simply renaming these security vars accordingly? Also, in case you know: why doesn’t wrangler issue the same kind of warnings on GitHub? On my GitHub Action (https://github.com/brycewray/hugo-site/blob/main/.github/workflows/deploy-hugo-site.yml), the CFP-relevant parts are:
- name: Publish to CFP
if: ${{ env.GITHUB == 'true' }}
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CFP_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: 'static-site-v2' # was 'static-site'
directory: 'public'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to CFP
if: ${{ env.GITHUB == 'true' }}
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CFP_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: 'static-site-v2' # was 'static-site'
directory: 'public'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
1 Reply
kian
kian12mo ago
So is the solution simply renaming these security vars accordingly?
Yes
why doesn’t wrangler issue the same kind of warnings on GitHub?
https://github.com/cloudflare/wrangler-action/blob/bd50d10af9b8d34f7d6287f6a162aacab4b218e5/src/index.ts#L51-L52
Want results from more Discord servers?
Add your server