Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid 429 Response code (Too many requests) #37

Closed
Ryrden opened this issue Jul 15, 2024 · 5 comments
Closed

Avoid 429 Response code (Too many requests) #37

Ryrden opened this issue Jul 15, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@Ryrden
Copy link

Ryrden commented Jul 15, 2024

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
Copy link
Owner

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

  • Only call the API for the files that were actually modified, but that can only work with PRs and not with regular commits (as actions can run for a changeset of multiple commits)
  • Detect errors 429 in https://github.com/sinedied/devto-cli, and add delay + retry when it occurs

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

@sinedied sinedied added the enhancement New feature or request label Jul 16, 2024
@Ryrden
Copy link
Author

Ryrden commented Jul 16, 2024

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: sinedied/devto-cli#33

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

@sinedied
Copy link
Owner

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
Copy link
Author

Ryrden commented Jul 18, 2024

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
Copy link
Owner

Thanks for confirming :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants