Skip to content

Commit 948369d

Browse files
authored
Merge branch 'main' into 3322-introduce-invoker-commands-instead-of-js-glue-code
2 parents 1eb40c7 + a079e48 commit 948369d

File tree

38 files changed

+969
-446
lines changed

38 files changed

+969
-446
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: "Auto commit and merge changes"
3+
description: "Creates a new branch and commits current changes and merges it afterwards to retrigger pipeline"
4+
inputs:
5+
branch-name:
6+
description: "The new branch name to commit to"
7+
required: true
8+
commit-message:
9+
description: "The message you want to commit"
10+
required: true
11+
commit-files:
12+
description: "The files which should be commited with `git add xxx`"
13+
required: true
14+
auto-merge-app-id:
15+
description: "The id for github app to allow auto-merge"
16+
required: true
17+
auto-merge-private-key:
18+
description: "The private key for github app to allow auto-merge"
19+
required: true
20+
gh-token:
21+
description: "The default github token"
22+
required: true
23+
24+
runs:
25+
using: "composite"
26+
steps:
27+
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
28+
- name: 🧬 Generate a token
29+
id: generate-token
30+
uses: actions/create-github-app-token@v2
31+
with:
32+
app-id: ${{ inputs.auto-merge-app-id }}
33+
private-key: ${{ inputs.auto-merge-private-key }}
34+
35+
- name: 🏗️ Create new branch and commit changes
36+
shell: bash
37+
env:
38+
GH_TOKEN: ${{ inputs.gh-token }}
39+
NEW_PR_BRANCH: ${{ inputs.branch-name }}
40+
COMMIT_MESSAGE: ${{ inputs.commit-message }}
41+
COMMIT_FILES: ${{ inputs.commit-files }}
42+
run: |
43+
git config --global user.name "github-actions[bot]"
44+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
45+
46+
git checkout -b "$NEW_PR_BRANCH"
47+
git add $COMMIT_FILES
48+
49+
# We can't use semantic commits here because of the if statement in the workflow
50+
git commit --no-verify -m "$COMMIT_MESSAGE"
51+
git push -f origin "$NEW_PR_BRANCH"
52+
53+
- name: 🪗 Create Pull Request
54+
shell: bash
55+
env:
56+
GH_TOKEN: ${{ inputs.gh-token }}
57+
COMMIT_MESSAGE: ${{ inputs.commit-message }}
58+
NEW_PR_BRANCH: ${{ inputs.branch-name }}
59+
BASE_BRANCH: ${{ github.head_ref }}
60+
run: |
61+
gh pr create --base "$BASE_BRANCH" --head "$NEW_PR_BRANCH" --title "Automated PR: $COMMIT_MESSAGE" --body "This PR was created automatically by a GitHub Action."
62+
63+
- name: 🤖 Squash the PR
64+
shell: bash
65+
run: gh pr merge --squash "$NEW_PR_BRANCH"
66+
env:
67+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
68+
NEW_PR_BRANCH: ${{ inputs.branch-name }}

.github/actions/npm-cache/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
with:
2525
node-version: ${{ inputs.nodeVersion }}
2626

27-
- name: Display node and npm version
27+
- name: 🖼️ Display node and npm version
2828
shell: bash
2929
run: |
3030
node --version

.github/workflows/02-e2e-regenerated-snapshots-commit.yml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
permissions:
2929
contents: write
3030
pull-requests: write
31-
env:
32-
NEW_PR_BRANCH: "${{ github.head_ref }}-auto"
3331
steps:
3432
- name: ⏬ Checkout repo
3533
uses: actions/checkout@v4
@@ -66,35 +64,12 @@ jobs:
6664
name: snapshots-showcases
6765
path: ./__snapshots__/
6866

69-
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
70-
- name: 🧬 Generate a token
71-
id: generate-token
72-
uses: actions/create-github-app-token@v2
67+
- name: 🚘 Auto commit
68+
uses: ./.github/actions/auto-commit
7369
with:
74-
app-id: ${{ vars.AUTO_MERGE_APP_ID }}
75-
private-key: ${{ secrets.AUTO_MERGE_PRIVATE_KEY }}
76-
77-
- name: 🏗️ Create new branch and commit changes
78-
env:
79-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
run: |
81-
git config --global user.name "github-actions[bot]"
82-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
83-
84-
git checkout -b "$NEW_PR_BRANCH"
85-
git add __snapshots__/*
86-
87-
# We can't use semantic commits here because of the if statement in the workflow
88-
git commit --no-verify -m "auto update snapshots"
89-
git push -f origin "$NEW_PR_BRANCH"
90-
91-
- name: 🪗 Create Pull Request
92-
env:
93-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
run: |
95-
gh pr create --base ${{ github.head_ref }} --head "$NEW_PR_BRANCH" --title "Automated PR: Auto update snapshots" --body "This PR was created automatically by a GitHub Action."
96-
97-
- name: 🤖 Squash the PR
98-
run: gh pr merge --squash "$NEW_PR_BRANCH"
99-
env:
100-
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
70+
branch-name: "${{ github.head_ref }}-auto"
71+
commit-message: "auto update snapshots"
72+
commit-files: "__snapshots__/*"
73+
auto-merge-app-id: ${{ vars.AUTO_MERGE_APP_ID }}
74+
auto-merge-private-key: ${{ secrets.AUTO_MERGE_PRIVATE_KEY }}
75+
gh-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Auto-Format with Stylelint and Prettier
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
format:
8+
name: 🆙 Auto-Format
9+
if: ${{ github.actor == 'dependabot[bot]' }}
10+
runs-on: ubuntu-24.04 # Use Ubuntu 24.04 explicitly
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
steps:
15+
- name: ⏬ Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.head_ref }}
19+
20+
- name: 🔍 Check if Stylelint or Prettier update PR
21+
id: check_pr
22+
run: |
23+
echo "PR title: ${{ github.event.pull_request.title }}"
24+
if [[ "${{ github.event.pull_request.title }}" =~ "bump stylelint from" ]]; then
25+
echo "Stylelint update detected."
26+
echo "stylelint_update=true" >> $GITHUB_ENV
27+
elif [[ "${{ github.event.pull_request.title }}" =~ "bump prettier from" ]]; then
28+
echo "Prettier update detected."
29+
echo "prettier_update=true" >> $GITHUB_ENV
30+
else
31+
echo "No Stylelint or prettier updates detected."
32+
fi
33+
34+
- name: 🆙 Set up Node.js
35+
if: env.stylelint_update == 'true' || env.prettier_update == 'true'
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version-file: ".nvmrc"
39+
40+
- name: ⏬ Install dependencies
41+
if: env.stylelint_update == 'true' || env.prettier_update == 'true'
42+
run: |
43+
npm ci
44+
45+
- name: 🏃 Run Stylelint to format the code
46+
if: env.stylelint_update == 'true'
47+
run: |
48+
npm run build --workspace=@db-ux/core-stylelint
49+
npm run lint:stylelint --fix
50+
51+
- name: 🏃 Run Prettier to format the code
52+
if: env.prettier_update == 'true'
53+
run: |
54+
npm run fmt
55+
56+
- name: 🚘 Auto commit
57+
if: env.stylelint_update == 'true' || env.prettier_update == 'true'
58+
uses: ./.github/actions/auto-commit
59+
with:
60+
branch-name: "${{ github.head_ref }}-auto"
61+
commit-message: "auto format code"
62+
commit-files: "."
63+
auto-merge-app-id: ${{ vars.AUTO_MERGE_APP_ID }}
64+
auto-merge-private-key: ${{ secrets.AUTO_MERGE_PRIVATE_KEY }}
65+
gh-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pull-request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
dependabot:
1616
uses: ./.github/workflows/99-auto-merge.yml
1717

18+
self-healing-dependabot-updates:
19+
uses: ./.github/workflows/99-self-healing-dependabot-updates.yml
20+
secrets: inherit
21+
1822
codeql:
1923
uses: ./.github/workflows/99-codeql-analysis.yml
2024

Loading

__snapshots__/custom-select/showcase/chromium-highContrast/should-have-same-aria-snapshot/DBCustomSelect-should-have-same-aria-snapshot.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,46 @@
169169
- text: Option 2 none" / "
170170
- status
171171
- text: chevron_down" / "
172+
- link "Validation arrow_up_right\" / \""
173+
- text: (Default) No Validation
174+
- group:
175+
- article:
176+
- radiogroup "id-102061-(Default) No Validation":
177+
- list:
178+
- listitem:
179+
- radio "Option 1 none\" / \""
180+
- text: Option 1 none" / "
181+
- listitem:
182+
- radio "Option 2 none\" / \""
183+
- text: Option 2 none" / "
184+
- status
185+
- text: chevron_down" / " Invalid
186+
- group:
187+
- article:
188+
- radiogroup "id-102062-Invalid":
189+
- list:
190+
- listitem:
191+
- radio "Option 1 none\" / \""
192+
- text: Option 1 none" / "
193+
- listitem:
194+
- radio "Option 2 none\" / \""
195+
- text: Option 2 none" / "
196+
- text: exclamation_mark_circle" / " Invalid Message
197+
- status
198+
- text: chevron_down" / " Valid
199+
- group:
200+
- article:
201+
- radiogroup "id-102063-Valid":
202+
- list:
203+
- listitem:
204+
- radio "Option 1 none\" / \""
205+
- text: Option 1 none" / "
206+
- listitem:
207+
- radio "Option 2 none\" / \""
208+
- text: Option 2 none" / "
209+
- text: "check_circle\" / \" TODO: Add a validMessage"
210+
- status
211+
- text: chevron_down" / "
172212
- link "Required arrow_up_right\" / \""
173213
- text: (Default) False
174214
- group:
Loading

__snapshots__/custom-select/showcase/chromium/should-have-same-aria-snapshot/DBCustomSelect-should-have-same-aria-snapshot.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,46 @@
169169
- text: Option 2 none" / "
170170
- status
171171
- text: chevron_down" / "
172+
- link "Validation arrow_up_right\" / \""
173+
- text: (Default) No Validation
174+
- group:
175+
- article:
176+
- radiogroup "id-102061-(Default) No Validation":
177+
- list:
178+
- listitem:
179+
- radio "Option 1 none\" / \""
180+
- text: Option 1 none" / "
181+
- listitem:
182+
- radio "Option 2 none\" / \""
183+
- text: Option 2 none" / "
184+
- status
185+
- text: chevron_down" / " Invalid
186+
- group:
187+
- article:
188+
- radiogroup "id-102062-Invalid":
189+
- list:
190+
- listitem:
191+
- radio "Option 1 none\" / \""
192+
- text: Option 1 none" / "
193+
- listitem:
194+
- radio "Option 2 none\" / \""
195+
- text: Option 2 none" / "
196+
- text: exclamation_mark_circle" / " Invalid Message
197+
- status
198+
- text: chevron_down" / " Valid
199+
- group:
200+
- article:
201+
- radiogroup "id-102063-Valid":
202+
- list:
203+
- listitem:
204+
- radio "Option 1 none\" / \""
205+
- text: Option 1 none" / "
206+
- listitem:
207+
- radio "Option 2 none\" / \""
208+
- text: Option 2 none" / "
209+
- text: "check_circle\" / \" TODO: Add a validMessage"
210+
- status
211+
- text: chevron_down" / "
172212
- link "Required arrow_up_right\" / \""
173213
- text: (Default) False
174214
- group:
Loading

0 commit comments

Comments
 (0)