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

Add input github-token #181

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'test-latest-scheduled'
name: 'test-latest'
on:
pull_request:
push:
Expand Down Expand Up @@ -29,6 +29,8 @@ jobs:
fi
- name: Setup rye
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: rye sync
working-directory: __tests__/fixtures/rye-project
- name: Rye path is not added to .profile
Expand All @@ -39,3 +41,11 @@ jobs:
else
exit 1
fi
test-without-github-token:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup rye
uses: ./
- run: rye sync
working-directory: __tests__/fixtures/rye-project
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
uses: ./
with:
version: ${{ matrix.rye-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: |
which rye
test-checksum:
Expand All @@ -57,6 +58,7 @@ jobs:
with:
version: '0.11.0'
checksum: ${{ matrix.checksum }}
github-token: ${{ secrets.GITHUB_TOKEN }}
test-modify-path-warning:
runs-on: ubuntu-latest
steps:
Expand All @@ -65,6 +67,7 @@ jobs:
uses: ./
with:
version: '0.21.0'
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: which rye
- name: Rye path is added to .profile
run: |
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ One option is to use a cron job to delete files older than 7 days like below.
0 0 * * * find /home/ubuntu/setup-rye-cache -type f -mtime +7 -exec rm -rf {} \;
```

### API rate limit

To avoid hitting the error `API rate limit exceeded` you can supply a GitHub token with the `github-token` input.

```yaml
- name: Install rye and supply a GitHub token
uses: eifinger/setup-rye@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```

## Limitations

1. Currently only Linux and macOS is supported see [issue #10](https://github.com/eifinger/setup-rye/issues/10)
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
checksum:
description: 'The checksum of the rye version to install'
required: false
github-token:
description: 'Used to increase the rate limit when retrieving versions and downloading rye.'
required: false
enable-cache:
description: 'Enable caching of .venv'
default: 'false'
Expand Down
Loading
Loading