Skip to content

Commit b92ef1a

Browse files
authored
Propagate GH_TOKEN (#1623)
This attempts to address an issue that java update PRs have the wrong owner and do not trigger tests properly: #1605 (comment)
1 parent 3654009 commit b92ef1a

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

provider-ci/internal/pkg/templates/bridged/.github/workflows/upgrade-java.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ permissions:
2323
pull-requests: write
2424

2525
env:
26+
27+
# upgrade-provider calls into gh CLI tool to open PRs that uses GH_TOKEN env var, which is not obivous.
28+
# setting this correctly makes sure the PR has the correct owner and permissions work as expected.
29+
GH_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN || secrets.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
30+
2631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732

2833
jobs:
@@ -58,5 +63,6 @@ jobs:
5863
env:
5964
V: ${{inputs.version}}
6065
REPO: ${{github.repository}}
66+
GH_TOKEN: ${{env.GH_TOKEN}}
6167
run: |
6268
upgrade-provider "$REPO" --kind=java --java-version="$V"

provider-ci/test-providers/acme/.github/workflows/upgrade-java.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ permissions:
2323
pull-requests: write
2424

2525
env:
26+
27+
# upgrade-provider calls into gh CLI tool to open PRs that uses GH_TOKEN env var, which is not obivous.
28+
# setting this correctly makes sure the PR has the correct owner and permissions work as expected.
29+
GH_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN || secrets.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
30+
2631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732

2833
jobs:
@@ -58,5 +63,6 @@ jobs:
5863
env:
5964
V: ${{inputs.version}}
6065
REPO: ${{github.repository}}
66+
GH_TOKEN: ${{env.GH_TOKEN}}
6167
run: |
6268
upgrade-provider "$REPO" --kind=java --java-version="$V"

provider-ci/test-providers/aws/.github/workflows/upgrade-java.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ permissions:
2323
pull-requests: write
2424

2525
env:
26+
27+
# upgrade-provider calls into gh CLI tool to open PRs that uses GH_TOKEN env var, which is not obivous.
28+
# setting this correctly makes sure the PR has the correct owner and permissions work as expected.
29+
GH_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN || secrets.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
30+
2631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732

2833
jobs:
@@ -58,5 +63,6 @@ jobs:
5863
env:
5964
V: ${{inputs.version}}
6065
REPO: ${{github.repository}}
66+
GH_TOKEN: ${{env.GH_TOKEN}}
6167
run: |
6268
upgrade-provider "$REPO" --kind=java --java-version="$V"

provider-ci/test-providers/cloudflare/.github/workflows/upgrade-java.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ permissions:
2323
pull-requests: write
2424

2525
env:
26+
27+
# upgrade-provider calls into gh CLI tool to open PRs that uses GH_TOKEN env var, which is not obivous.
28+
# setting this correctly makes sure the PR has the correct owner and permissions work as expected.
29+
GH_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN || secrets.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
30+
2631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732

2833
jobs:
@@ -58,5 +63,6 @@ jobs:
5863
env:
5964
V: ${{inputs.version}}
6065
REPO: ${{github.repository}}
66+
GH_TOKEN: ${{env.GH_TOKEN}}
6167
run: |
6268
upgrade-provider "$REPO" --kind=java --java-version="$V"

provider-ci/test-providers/docker/.github/workflows/upgrade-java.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ permissions:
2323
pull-requests: write
2424

2525
env:
26+
27+
# upgrade-provider calls into gh CLI tool to open PRs that uses GH_TOKEN env var, which is not obivous.
28+
# setting this correctly makes sure the PR has the correct owner and permissions work as expected.
29+
GH_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN || secrets.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
30+
2631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732

2833
jobs:
@@ -58,5 +63,6 @@ jobs:
5863
env:
5964
V: ${{inputs.version}}
6065
REPO: ${{github.repository}}
66+
GH_TOKEN: ${{env.GH_TOKEN}}
6167
run: |
6268
upgrade-provider "$REPO" --kind=java --java-version="$V"

provider-ci/test-providers/xyz/.github/workflows/upgrade-java.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ permissions:
2323
pull-requests: write
2424

2525
env:
26+
27+
# upgrade-provider calls into gh CLI tool to open PRs that uses GH_TOKEN env var, which is not obivous.
28+
# setting this correctly makes sure the PR has the correct owner and permissions work as expected.
29+
GH_TOKEN: ${{ secrets.PULUMI_PROVIDER_AUTOMATION_TOKEN || secrets.PULUMI_BOT_TOKEN || secrets.GITHUB_TOKEN }}
30+
2631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732

2833
jobs:
@@ -58,5 +63,6 @@ jobs:
5863
env:
5964
V: ${{inputs.version}}
6065
REPO: ${{github.repository}}
66+
GH_TOKEN: ${{env.GH_TOKEN}}
6167
run: |
6268
upgrade-provider "$REPO" --kind=java --java-version="$V"

0 commit comments

Comments
 (0)