cloudflare / pages-action

MIT License
440 stars 91 forks source link

Deprecation warning about `wrangler pages publish` #88

Open brycewray opened 1 year ago

brycewray commented 1 year ago

When I run this action, it works but I get this error message in the log:

▲ [WARNING] `wrangler pages publish` is deprecated and will be removed in the next major version.

  Please use `wrangler pages deploy` instead, which accepts exactly the same arguments.

This is the relevant part of my overall workflow file:

      - name: Publish to CFP (cond. - host = CFP)
        if: ${{ env.HOST == 'CFP' }}
        uses: cloudflare/pages-action@v1
        with:
          apiToken: ${{ secrets.CFP_API_TOKEN }}
          accountID: ${{ secrets.CF_ACCOUNT_ID }}
          projectName: 'static-site-v2' # was 'static-site' (now 'static-site-old')
          directory: 'public'
          gitHubToken: ${{ secrets.GITHUB_TOKEN }}
          wranglerVersion: '3' # enable Wrangler v3

. . . although I was seeing this before I added the wranglerVersion line to the with section.

Does the deprecation warning mean I need to pass some additional args?

rodbs commented 1 year ago

I guess they need to update the action script according to the new wrangler parameters: https://developers.cloudflare.com/workers/wrangler/commands/#publish-1

WalshyDev commented 1 year ago

Yeah I intend to cut a v2 at some point soon which defaults wrangler to v3 and uses the correct command. Deprecation is expected and fine for now. This command won't be removed until at least wrangler v4.

smvz commented 9 months ago

I don't know whether or not the pull request #101 works as-is (I see that code is in two places and it only changes one) but a change of that nature would deal with the deprecation warning in a way that is non-breaking, so people using the v1 action with wrangler v3 aren't confused by it.

rodrigoalcarazdelaosa commented 5 months ago

I see that code is in two places and it only changes one

I only see it here. Where else is the pages publish referenced?

smvz commented 5 months ago

I believe I was referring to here. I see now though that the .husky directory contains a pre-commit script to build index.js from src/index.ts, so it is just the one place.