Skip to content

Commit

Permalink
Add input github-token
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Feb 24, 2024
1 parent 2c36d4c commit e519cbb
Show file tree
Hide file tree
Showing 9 changed files with 9,689 additions and 14,899 deletions.
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
File renamed without changes.
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

0 comments on commit e519cbb

Please sign in to comment.