Skip to content

Commit 9e310fb

Browse files
authored
🚸 automatically use GitHub token (#323)
This PR builds on #321 and replaces the use of `@octokit/action` with `@octokit/core`. In addition, it adds an optional `token` input to the action that defaults to the repositories GitHub token and is used for authentication. Thus, specifying the token explicitly is no longer necessary once this PR is merged.
1 parent eb66033 commit 9e310fb

File tree

10 files changed

+32
-28867
lines changed

10 files changed

+32
-28867
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
cache: npm
2929
- run: npm ci
3030
- run: npm run all
31-
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3331

3432
# test action works running from the graph
3533
test:
@@ -42,8 +40,6 @@ jobs:
4240
- uses: actions/checkout@v4
4341
- uses: ./
4442
id: z3
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4743
- run: echo "${{ steps.z3.outputs.z3-root }}"
4844
- run: '[ -d "${{ steps.z3.outputs.z3-root }}" ] || exit 1'
4945
- if: runner.os != 'Windows'

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ To download the latest version of Z3 for the host platform and add it to the `PA
1010
- name: Setup Z3
1111
id: z3
1212
uses: cda-tum/setup-z3@v1
13-
env:
14-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1513
```
1614
1715
This action creates a `z3-root` output variable that contains the path to the root directory of the Z3 installation and exports the `Z3_ROOT` environment variable for subsequent steps in a job. The output variable can be accessed as `${{ steps.z3.outputs.z3-root }}`.
1816

19-
> **Warning**
20-
> The `GITHUB_TOKEN` environment variable is required to download the Z3 binaries from GitHub releases.
21-
> The token is automatically provided by GitHub Actions and does not need to be configured manually.
22-
2317
### Specifying a version
2418

2519
In many cases, it is convenient to use a specific version of Z3. This can be done by specifying the `version` input:
@@ -30,8 +24,6 @@ In many cases, it is convenient to use a specific version of Z3. This can be don
3024
uses: cda-tum/setup-z3@v1
3125
with:
3226
version: 4.11.2
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3527
```
3628

3729
> **Note**
@@ -48,8 +40,6 @@ If you want to explicitly specify the platform and architecture for which Z3 sho
4840
with:
4941
platform: macOS
5042
architecture: arm64
51-
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5343
```
5444

5545
> **Note**
@@ -70,6 +60,4 @@ By default, the action only adds Z3 into `PATH`, meaning it cannot be used as a
7060
uses: cda-tum/setup-z3@v1
7161
with:
7262
add_to_library_path: true
73-
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7563
```

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
description: "Add Z3 to the library path variables, such that it can be used as a static/dynamic library. Defaults to false."
1919
required: false
2020
default: "false"
21+
token:
22+
description: "The token that the action will use to query the GitHub API. Defaults to the repository's GitHub token."
23+
required: false
24+
default: ${{ github.token }}
2125
outputs:
2226
z3-root:
2327
description: "The root directory of the Z3 installation"

0 commit comments

Comments
 (0)