Skip to content

feat(Forms): add support for Swedish bank account numbers and IBAN in BankAccountNumber #2066

feat(Forms): add support for Swedish bank account numbers and IBAN in BankAccountNumber

feat(Forms): add support for Swedish bank account numbers and IBAN in BankAccountNumber #2066

Workflow file for this run

name: Deploy Preview
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- '**'
- '!**--skip-ci'
- '!**--visual-reports'
- '!wip/**'
- '!experiments/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
jobs:
deploy-preview:
name: Build and deploy (branch preview)
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
pull-requests: write
steps:
- name: Git checkout
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v5
with:
node-version-file: 'package.json'
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace dnb-design-system-portal build:mini
- name: Deploy to Cloudflare Pages (branch preview)
id: pages_deploy
run: |
set -euo pipefail
OUTPUT="$(yarn workspace dnb-design-system-portal wrangler pages deploy ./public \
--project-name eufemia \
--branch "${{ github.head_ref || github.ref_name }}" \
--commit-dirty=true)"
echo "$OUTPUT"
ALIAS_URL="$(echo "$OUTPUT" | sed -nE 's/.*Deployment alias URL:\s*(https:\/\/[^ ]+).*/\1/p')"
DEPLOYMENT_URL="$(echo "$OUTPUT" | sed -nE 's/.*Take a peek over at\s*(https:\/\/[^ ]+).*/\1/p')"
echo "alias_url=$ALIAS_URL" >> "$GITHUB_OUTPUT"
echo "deployment_url=$DEPLOYMENT_URL" >> "$GITHUB_OUTPUT"
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Post or update preview comment
if: success() && github.event.pull_request
uses: actions/github-script@v7
env:
ALIAS_URL: ${{ steps.pages_deploy.outputs.alias_url }}
DEPLOYMENT_URL: ${{ steps.pages_deploy.outputs.deployment_url }}
with:
script: |
const aliasUrl = process.env.ALIAS_URL;
const deploymentUrl = process.env.DEPLOYMENT_URL;
const marker = "<!-- pages-preview-comment -->";
const body = [
marker,
"**Branch Preview URL (stable):**",
aliasUrl,
"",
"```",
aliasUrl,
"```",
"",
"**Deployment URL (unique):**",
deploymentUrl,
"",
"```",
deploymentUrl,
"```",
""
].join("\n");
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const existing = comments.find(c => c.body?.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}