sinedied / publish-devto

:postbox: GitHub Action to publish markdown files on dev.to platform, with assets hosted on GitHub.
MIT License
38 stars 8 forks source link

Avoid 429 Response code (Too many requests) #37

Closed Ryrden closed 1 month ago

Ryrden commented 1 month ago

Hi, I implemented the Ci/CD pipeline with the publish-devto a long time ago when I just had 2 or 3 articles but now I have the double (cause it was translated), and I'm getting 429 HTTP status code and I'd like to ask for help, What could I do to avoid this? any retry flag to configure or workaround?

image

here is my script

name: publish
on:
  push: 
    branches:
      - main

jobs:
  publish:
    runs-on: ubuntu-latest
    if: "contains(github.event.head_commit.message, 'post:')"

    steps:
      - uses: actions/checkout@v2
      - name: Publish articles on dev.to
        uses: sinedied/publish-devto@v2
        with:
          devto_key: ${{ secrets.DEVTO_TOKEN }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          files: '_posts/**/*.md'
          branch: main
          conventional_commits: true
sinedied commented 1 month ago

Yes, I've hit that issue also. There are a few changes that could be made to fix that error:

Unfortunately, I have currently no time to spend on this, but any PRs are welcome.

Ryrden commented 1 month ago

Hi, thanks for the feedback.

The idea of only calling for modified files it's great but this means analyzing my part on changed files from a commit (the problem you mentioned I think). Unfortunately, this will solve just my problem and you have already said that it's an existent issue...

The second idea looks great, knowing can solve other users' problems, I didn't see the codebase yet but knowing the code must call the devto-cli I think I can open a PR to fix it.

I found the same issue on devto-cli codebase: https://github.com/sinedied/devto-cli/issues/33

next days probably I'll look and try to open a PR. Thanks a lot!

sinedied commented 1 month ago

Thanks for the PR!

I've released a new version of the CLI and updated the github actions, let me know if it fixes your issue.

Ryrden commented 1 month ago

I've just tested the pipeline on my website, and yes! it's fixed!

Thanks a lot!

Thanks for the PR!

I've released a new version of the CLI and updated the github actions, let me know if it fixes your issue.

sinedied commented 1 month ago

Thanks for confirming :)