-
Notifications
You must be signed in to change notification settings - Fork 135
50 lines (41 loc) · 1.95 KB
/
validate-remote-assets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Validate remote assets
on:
pull_request:
branches:
- main
jobs:
check-secured-fields-assets:
if: contains(github.head_ref, 'changeset-release')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Getting SF_VERSION in the codebase
run: |
echo "SF_VERSION=$(grep -e 'SF_VERSION' packages/lib/src/components/internal/SecuredFields/lib/constants.ts | cut -d "'" -f2)" >> $GITHUB_ENV
- name: Encoding test origin URL to base64
run: |
echo "BTOA_TEST_ORIGIN=$(echo ${{ secrets.TEST_ORIGIN }} | base64)" >> $GITHUB_ENV
- name: Requesting securedFields in production
id: securedFieldsRequest
uses: fjogeleit/http-request-action@main
with:
url: "https://checkoutshopper-live-us.adyen.com/checkoutshopper/securedfields/${{secrets.TEST_CLIENT_KEY}}/${{ env.SF_VERSION }}/securedFields.html?type=card&d=${{env.BTOA_TEST_ORIGIN}}"
method: "GET"
customHeaders: '{"Origin": "${{secrets.TEST_ORIGIN}}"}'
- name: Comment PR that request failed
if: failure()
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
await github.rest.issues.createComment({ issue_number, owner, repo, body: '⚠️ WARNING: SecuredFields v${{ env.SF_VERSION }} might not be available live ⚠️ });
- name: Comment PR that request succeeded
if: success()
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
await github.rest.issues.createComment({ issue_number, owner, repo, body: '✅ SecuredFields v${{ env.SF_VERSION }} are available live' });