Skip to content

Commit 8805a00

Browse files
sr010Sindhura3
andauthored
Token Validation (twilio#195)
* Update release.yml * Update release.yml * Update release.yml * Update release.yml Co-authored-by: sraghav <[email protected]> Co-authored-by: Sindhura Chamala <[email protected]>
1 parent ecb2ae5 commit 8805a00

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/release.yml

+20-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,23 @@ on:
1212
description: 'HomeBrew prerelease'
1313
default: 'false'
1414
jobs:
15+
token-validation:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Validate REPO_ACCESS_TOKEN
19+
uses: actions/checkout@v2
20+
with:
21+
repository: 'twilio/twilio-oai'
22+
token: ${{ secrets.REPO_ACCESS_TOKEN }}
23+
- name: Validate AWS tokens
24+
uses: aws-actions/configure-aws-credentials@v1
25+
with:
26+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
27+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28+
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
29+
aws-region: us-east-1
1530
notify-start:
31+
needs: [ token-validation ]
1632
name: Notify Release Started
1733
runs-on: ubuntu-latest
1834
steps:
@@ -32,6 +48,7 @@ jobs:
3248
SLACK_MESSAGE: 'Release Started :rocket:'
3349
MSG_MINIMAL: actions url
3450
test:
51+
needs: [ token-validation ]
3552
runs-on: ubuntu-latest
3653
strategy:
3754
matrix:
@@ -49,6 +66,7 @@ jobs:
4966
run: make test
5067
update-api-specs:
5168
runs-on: ubuntu-latest
69+
needs: [ token-validation ]
5270
# needs: [test]
5371
outputs:
5472
change-log: ${{ steps.update-specs.outputs.change-log }}
@@ -124,7 +142,7 @@ jobs:
124142
REPO_NAME: twilio/twilio-cli
125143
INPUTS: '{ "change-log": ${{ toJSON(needs.update-api-specs.outputs.change-log) }}, "version-type": "${{needs.update-api-specs.outputs.version-type}}", "homebrew-branch": "${{github.event.inputs.homebrew-branch}}", "homebrew-prerelease": "${{github.event.inputs.homebrew-prerelease}}" }'
126144
notify-complete-fail:
127-
if: ${{ failure() || cancelled() }}
145+
if: ${{ needs.token-validation.result != 'failure' && (failure() || cancelled()) }}
128146
needs: [ triggerCliWorkflow ]
129147
name: Notify Release Failed
130148
runs-on: ubuntu-latest
@@ -139,4 +157,4 @@ jobs:
139157
SLACK_ICON_EMOJI: ":ship:"
140158
SLACK_TITLE: "Twilio Cli-core"
141159
SLACK_MESSAGE: 'Release workflow Failed'
142-
MSG_MINIMAL: actions url
160+
MSG_MINIMAL: actions url

0 commit comments

Comments
 (0)