Skip to content

Commit 23b59ed

Browse files
authored
chore: migrate to setup-github-token action everywhere (#1504)
* chore: mirgrate to setup-github-token action everywhere * fix: discrepancies
1 parent b35d1c0 commit 23b59ed

File tree

6 files changed

+47
-92
lines changed

6 files changed

+47
-92
lines changed

.changeset/curly-cameras-warn.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"cicd-build-publish-artifacts-go": minor
3+
"cicd-changesets": minor
4+
"update-actions": minor
5+
"ci-lint-go": minor
6+
"ci-test-go": minor
7+
---
8+
9+
chore: migrate to setup-github-token action in place of individual calls

actions/ci-lint-go/action.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,29 +85,16 @@ runs:
8585
with:
8686
fetch-depth: ${{ inputs.checkout-repo-fetch-depth }}
8787

88-
- name: Assume aws gati role
89-
if: inputs.use-gati == 'true'
90-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
91-
with:
92-
role-to-assume: ${{ inputs.aws-role-arn-gati }}
93-
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
94-
aws-region: ${{ inputs.aws-region }}
95-
mask-aws-account-id: true
96-
97-
- name: Get github token from gati
88+
- name: Setup gh token
9889
if: inputs.use-gati == 'true'
9990
id: get-gh-token
100-
uses: smartcontractkit/chainlink-github-actions/github-app-token-issuer@main
91+
uses: smartcontractkit/.github/actions/setup-github-token@setup-github-token/v1
10192
with:
102-
url: ${{ inputs.aws-lambda-url-gati }}
103-
104-
- name: Configure github token
105-
if: inputs.use-gati == 'true'
106-
shell: bash
107-
run: |
108-
git config --global \
109-
url."https://x-access-token:${{ steps.get-gh-token.outputs.access-token }}@github.com/".insteadOf \
110-
"https://github.com/"
93+
aws-role-arn: ${{ inputs.aws-role-arn-gati }}
94+
aws-lambda-url: ${{ inputs.aws-lambda-url-gati }}
95+
aws-region: ${{ inputs.aws-region }}
96+
aws-role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
97+
set-git-config: "true"
11198

11299
- name: Set env from files
113100
if: inputs.use-env-files == 'true'

actions/ci-test-go/action.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,29 +106,16 @@ runs:
106106
with:
107107
fetch-depth: ${{ inputs.checkout-repo-fetch-depth }}
108108

109-
- name: Assume aws gati role
110-
if: inputs.use-gati == 'true'
111-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
112-
with:
113-
role-to-assume: ${{ inputs.aws-role-arn-gati }}
114-
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
115-
aws-region: ${{ inputs.aws-region }}
116-
mask-aws-account-id: true
117-
118-
- name: Get github token from gati
109+
- name: Setup gh token
119110
if: inputs.use-gati == 'true'
120111
id: get-gh-token
121-
uses: smartcontractkit/chainlink-github-actions/github-app-token-issuer@main
112+
uses: smartcontractkit/.github/actions/setup-github-token@setup-github-token/v1
122113
with:
123-
url: ${{ inputs.aws-lambda-url-gati }}
124-
125-
- name: Configure github token
126-
if: inputs.use-gati == 'true'
127-
shell: bash
128-
run: |
129-
git config --global \
130-
url."https://x-access-token:${{ steps.get-gh-token.outputs.access-token }}@github.com/".insteadOf \
131-
"https://github.com/"
114+
aws-role-arn: ${{ inputs.aws-role-arn-gati }}
115+
aws-lambda-url: ${{ inputs.aws-lambda-url-gati }}
116+
aws-region: ${{ inputs.aws-region }}
117+
aws-role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
118+
set-git-config: "true"
132119

133120
- name: Set env from files
134121
if: inputs.use-env-files == 'true'

actions/cicd-build-publish-artifacts-go/action.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,29 +115,16 @@ runs:
115115
fetch-depth: ${{ inputs.checkout-repo-fetch-depth }}
116116
ref: ${{ inputs.checkout-ref }}
117117

118-
- name: Assume aws gati role
119-
if: inputs.use-gati == 'true'
120-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
121-
with:
122-
role-to-assume: ${{ inputs.aws-role-arn-gati }}
123-
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
124-
aws-region: ${{ inputs.aws-region }}
125-
mask-aws-account-id: true
126-
127-
- name: Get github token from gati
118+
- name: Setup gh token
128119
if: inputs.use-gati == 'true'
129120
id: get-gh-token
130-
uses: smartcontractkit/chainlink-github-actions/github-app-token-issuer@main
121+
uses: smartcontractkit/.github/actions/setup-github-token@setup-github-token/v1
131122
with:
132-
url: ${{ inputs.aws-lambda-url-gati }}
133-
134-
- name: Configure github token
135-
if: inputs.use-gati == 'true'
136-
shell: bash
137-
run: |
138-
git config --global \
139-
url."https://x-access-token:${{ steps.get-gh-token.outputs.access-token }}@github.com/".insteadOf \
140-
"https://github.com/"
123+
aws-role-arn: ${{ inputs.aws-role-arn-gati }}
124+
aws-lambda-url: ${{ inputs.aws-lambda-url-gati }}
125+
aws-region: ${{ inputs.aws-region }}
126+
aws-role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
127+
set-git-config: "true"
141128

142129
- name: Setup go
143130
uses: actions/setup-go@v6

actions/cicd-changesets/action.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,14 @@ outputs:
106106
runs:
107107
using: composite
108108
steps:
109-
- name: Assume aws gati role
110-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
111-
with:
112-
role-to-assume: ${{ inputs.aws-role-arn }}
113-
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
114-
aws-region: ${{ inputs.aws-region }}
115-
mask-aws-account-id: true
116-
117-
- name: Get github token from gati
109+
- name: Setup gh token
118110
id: get-gh-token
119-
uses: smartcontractkit/chainlink-github-actions/github-app-token-issuer@main
111+
uses: smartcontractkit/.github/actions/setup-github-token@setup-github-token/v1
120112
with:
121-
url: ${{ inputs.aws-lambda-url }}
113+
aws-role-arn: ${{ inputs.aws-role-arn }}
114+
aws-lambda-url: ${{ inputs.aws-lambda-url }}
115+
aws-region: ${{ inputs.aws-region }}
116+
aws-role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
122117

123118
- name: Checkout repo
124119
uses: actions/checkout@v6

actions/update-actions/action.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,23 @@ runs:
4141
with:
4242
fetch-depth: ${{ inputs.checkout-repo-fetch-depth }}
4343

44-
- name: Assume role capable of getting token from gati
45-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
46-
with:
47-
role-to-assume: ${{ inputs.aws-role-arn }}
48-
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
49-
aws-region: ${{ inputs.aws-region }}
50-
mask-aws-account-id: true
51-
52-
- name: Get github token from gati
44+
- name: Setup gh token
5345
id: get-gh-token
54-
uses: smartcontractkit/chainlink-github-actions/github-app-token-issuer@main
46+
uses: smartcontractkit/.github/actions/setup-github-token@setup-github-token/v1
5547
with:
56-
url: ${{ inputs.aws-lambda-url }}
57-
58-
- name: Assume role capable of getting token from gati for updater
59-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
60-
with:
61-
role-to-assume: ${{ inputs.aws-role-arn-updater }}
62-
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
48+
aws-role-arn: ${{ inputs.aws-role-arn }}
49+
aws-lambda-url: ${{ inputs.aws-lambda-url }}
6350
aws-region: ${{ inputs.aws-region }}
64-
mask-aws-account-id: true
51+
aws-role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
6552

66-
- name: Get github token from gati for updater
53+
- name: Setup gh token
6754
id: get-gh-token-updater
68-
uses: smartcontractkit/chainlink-github-actions/github-app-token-issuer@main
55+
uses: smartcontractkit/.github/actions/setup-github-token@setup-github-token/v1
6956
with:
70-
url: ${{ inputs.aws-lambda-url-updater }}
57+
aws-role-arn: ${{ inputs.aws-role-arn-updater }}
58+
aws-lambda-url: ${{ inputs.aws-lambda-url-updater }}
59+
aws-region: ${{ inputs.aws-region }}
60+
aws-role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
7161

7262
- name: Update custom action versions
7363
uses: smartcontractkit/.github/apps/update-action-versions@main

0 commit comments

Comments
 (0)