Skip to content

Commit a0544f5

Browse files
jajitarizwanreza
authored andcommitted
update references to env var GITHUB_TOKEN to GITHUB_ACCESS_TOKEN
1 parent 37c0f5d commit a0544f5

25 files changed

+62
-49
lines changed

.github/workflows/create-debugging-artifact.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
env:
4141
RELEEN_GITHUB_TOKEN: ${{ secrets.RELEEN_GITHUB_TOKEN }}
4242
run: |
43-
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
4443
export GITHUB_ACCESS_TOKEN="${RELEEN_GITHUB_TOKEN}"
4544
go test ./...
4645
@@ -50,7 +49,7 @@ jobs:
5049
RELEEN_GITHUB_TOKEN: ${{ secrets.RELEEN_GITHUB_TOKEN }}
5150
run: |
5251
set -euo pipefail
53-
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
52+
export GITHUB_ACCESS_TOKEN="${RELEEN_GITHUB_TOKEN}"
5453
5554
set -x
5655
go test --run '(using_kiln|baking_a_tile|generating_release_notes|updating_)' \

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
env:
3838
RELEEN_GITHUB_TOKEN: ${{ secrets.RELEEN_GITHUB_TOKEN }}
3939
run: |
40-
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
4140
export GITHUB_ACCESS_TOKEN="${RELEEN_GITHUB_TOKEN}"
4241
go test --covermode=atomic --coverprofile=kiln-${{github.sha}}-unit-test-code-coverage.out ./...
4342
@@ -53,7 +52,6 @@ jobs:
5352
RELEEN_GITHUB_TOKEN: ${{ secrets.RELEEN_GITHUB_TOKEN }}
5453
run: |
5554
set -euo pipefail
56-
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
5755
export GITHUB_ACCESS_TOKEN="${RELEEN_GITHUB_TOKEN}"
5856
5957
set -x
@@ -81,6 +79,5 @@ jobs:
8179
version: "~> v1"
8280
args: release --clean
8381
env:
84-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85-
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }}
8683

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
RELEEN_GITHUB_TOKEN: ${{ secrets.RELEEN_GITHUB_TOKEN }}
5151
run: |
5252
set -euo pipefail
53-
export GITHUB_TOKEN="${RELEEN_GITHUB_TOKEN}"
5453
export GITHUB_ACCESS_TOKEN="${RELEEN_GITHUB_TOKEN}"
5554
5655
set -x

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ brews:
3333
tap:
3434
owner: pivotal-cf
3535
name: kiln
36-
token: "{{ .Env.GITHUB_TOKEN }}"
36+
token: "{{ .Env.GITHUB_ACCESS_TOKEN }}"
3737
folder: HomebrewFormula
3838
ids:
3939
- homebrew

TILE_AUTHOR_GUIDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ release_sources:
358358
- type: "github"
359359
id: crhntr # (optional) the default ID in this case is the value of org
360360
org: "crhntr"
361-
github_token: $(variable "github_token")
361+
github_token: $(variable "github_access_token")
362362
```
363363

364364
**`github_token` is always required even for public repositories because we make API requests**
@@ -371,10 +371,10 @@ You will need to add the following flag to most commands:
371371

372372
```
373373
# Optional helper
374-
export GITHUB_TOKEN="$(gh auth status --show-token 2>&1 | grep 'Token:' | awk '{print $NF}')"
374+
export GITHUB_ACCESS_TOKEN="$(gh auth status --show-token 2>&1 | grep 'Token:' | awk '{print $NF}')"
375375
376376
# Example Kiln variable flag
377-
kiln fetch --variable="github_token=${GITHUB_TOKEN}"
377+
kiln fetch --variable="github_access_token=${GITHUB_ACCESS_TOKEN}"
378378
```
379379

380380
The value of `remote_path` in the BOSH release tarball lock is a URL.

internal/acceptance/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ go run github.com/onsi/ginkgo/ginkgo
2525
### Workflows
2626
These are written in Go and use [godog](https://github.com/cucumber/godog) (a Cucumber test framework).
2727

28-
> PS: Export GITHUB_TOKEN as an env var before running the acceptance tests
28+
> PS: Export GITHUB_ACCESS_TOKEN as an env var before running the acceptance tests
2929
3030
```bash
3131
# from anywhere in the repo you can run:
32-
export GITHUB_TOKEN="$(gh auth token)"
32+
export GITHUB_ACCESS_TOKEN="$(gh auth token)"
3333
go test -v --tags acceptance --timeout=1h github.com/pivotal-cf/kiln/internal/acceptance/workflows
3434
```
3535

internal/acceptance/workflows/baking_a_tile.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ Feature: As a developer, I want to bake a tile
55
When I invoke kiln
66
| bake |
77
| --final |
8-
| --variable=github_token="${GITHUB_TOKEN}" |
8+
| --variable=github_access_token="${GITHUB_ACCESS_TOKEN}" |
99
Then a Tile is created
1010
And the Tile contains
1111
| metadata/metadata.yml |
1212
| migrations/v1 |
1313
| releases/bpm-1.2.12.tgz |
1414
| releases/hello-release-0.2.3.tgz |
1515
And "bake_records/0.2.0-dev.json" contains substring: "version": "0.2.0-dev"
16-
And "bake_records/0.2.0-dev.json" contains substring: "source_revision": "6d5069f9dfb954ff77bb16c5aee670b9909f154a"
16+
And "bake_records/0.2.0-dev.json" contains substring: "source_revision": "896c44a006a24d8601ed09fd871b1a4423636d77"
1717
And "bake_records/0.2.0-dev.json" contains substring: "tile_directory": "."
1818
And "bake_records/0.2.0-dev.json" contains substring: "kiln_version": "0.0.0+acceptance-tests"
19-
And "bake_records/0.2.0-dev.json" contains substring: "file_checksum": "c94e5749bf676f03ff10539956e9445d309647c5299b16dfe71cb522e9258f0d"
20-
And "tile-0.2.0-dev.pivotal" has sha256 sum "c94e5749bf676f03ff10539956e9445d309647c5299b16dfe71cb522e9258f0d"
19+
And "bake_records/0.2.0-dev.json" contains substring: "file_checksum": "6754bb95193e42cd5706f810c3fdb1beead88e2a01601bb222e3e98818f90e8a"
20+
And "tile-0.2.0-dev.pivotal" has sha256 sum "6754bb95193e42cd5706f810c3fdb1beead88e2a01601bb222e3e98818f90e8a"
2121

2222
Scenario: it reads directory configuration from Kilnfile
2323
Given I have a tile source directory "testdata/tiles/non-standard-paths"

internal/acceptance/workflows/generating_release_notes.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Feature: As a robot, I want to generate release notes
1010
| --name=hello-release |
1111
| --version=v0.1.5 |
1212
| --without-download |
13-
| --variable=github_access_token="${GITHUB_TOKEN}" |
13+
| --variable=github_access_token="${GITHUB_ACCESS_TOKEN}" |
1414
And I write file "version"
1515
| 0.1.4 |
1616
And I execute git add Kilnfile.lock version
@@ -25,7 +25,7 @@ Feature: As a robot, I want to generate release notes
2525
| version |
2626
| 0.1.3 |
2727

28-
And the environment variable "GITHUB_TOKEN" is set
28+
And the environment variable "GITHUB_ACCESS_TOKEN" is set
2929

3030
When I invoke kiln
3131
| release-notes |

internal/acceptance/workflows/scenario/shared_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func loadGithubToken(ctx context.Context) (context.Context, error) {
107107
return ctx, nil
108108
}
109109

110-
token := os.Getenv("GITHUB_TOKEN")
110+
token := os.Getenv("GITHUB_ACCESS_TOKEN")
111111
if token == "" {
112112
token, err = getGithubTokenFromCLI()
113113
if err != nil {

internal/acceptance/workflows/scenario/step_funcs_github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func githubRepoHasReleaseWithTag(ctx context.Context, repoOrg, repoName, tag str
1313
if err != nil {
1414
return err
1515
}
16-
ghAPI, err := gh.Client(ctx, "", accessToken, accessToken)
16+
ghAPI, err := gh.Client(ctx, accessToken)
1717
if err != nil {
1818
return fmt.Errorf("failed to setup github client: %w", err)
1919
}

0 commit comments

Comments
 (0)