Skip to content

Commit 83a394b

Browse files
ci(workflows): pin actions to full sha (#166)
* ci(workflows): pin actions to full sha Signed-off-by: Dariusz Porowski <[email protected]> * style(dependabot): standardize quotes and formatting in configuration Signed-off-by: Dariusz Porowski <[email protected]> * fix(package): update format scripts to include specific file extensions Signed-off-by: Dariusz Porowski <[email protected]> * fix(package): update format scripts to use glob patterns for file extensions Signed-off-by: Dariusz Porowski <[email protected]> * fix(workflows): update run command syntax for Azure DevOps token retrieval Signed-off-by: Dariusz Porowski <[email protected]> --------- Signed-off-by: Dariusz Porowski <[email protected]>
1 parent 7c9b6aa commit 83a394b

File tree

4 files changed

+76
-35
lines changed

4 files changed

+76
-35
lines changed

.github/dependabot.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1+
# yaml-language-server: $schema=https://www.schemastore.org/dependabot-2.0.json
2+
# See GitHub's documentation for more information on this file:
3+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference
4+
---
15
version: 2
26
updates:
3-
- package-ecosystem: 'github-actions'
4-
directory: '/'
7+
- package-ecosystem: github-actions
8+
directory: /
59
schedule:
6-
interval: 'weekly'
10+
interval: weekly
711
groups:
812
all:
913
patterns:
10-
- '*'
11-
- package-ecosystem: 'npm'
12-
directory: '/'
14+
- "*"
15+
16+
- package-ecosystem: npm
17+
directory: /
1318
schedule:
14-
interval: 'weekly'
19+
interval: weekly
1520
groups:
1621
all:
1722
patterns:
18-
- '*'
19-
- package-ecosystem: 'devcontainers'
20-
directory: '/.devcontainer'
23+
- "*"
24+
25+
- package-ecosystem: devcontainers
26+
directory: /
2127
schedule:
2228
interval: weekly
2329
groups:
2430
all:
2531
patterns:
26-
- '*'
32+
- "*"

.github/workflows/build.yaml

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
2+
---
13
name: Build
4+
25
on:
36
push:
47
branches:
@@ -8,92 +11,118 @@ on:
811
pull_request:
912
branches:
1013
- main
14+
1115
permissions:
1216
contents: read
1317
pull-requests: read
1418
issues: read
1519
packages: write
20+
1621
env:
1722
CI_LINT: ${{ github.event_name == 'pull_request' }}
1823
CI_TEST: ${{ github.event_name == 'pull_request' }}
1924
CI_PUBLISH_RELEASE: ${{ github.repository == 'radius-project/dashboard' && startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' }}
2025
CI_PUBLISH_LATEST: ${{ github.repository == 'radius-project/dashboard' && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
26+
2127
jobs:
2228
build:
2329
name: Build Packages
2430
runs-on: ubuntu-latest
2531
steps:
2632
- name: Checkout code
27-
uses: actions/checkout@v5
33+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
34+
2835
- name: Parse release version and set environment variables
2936
run: python ./.github/scripts/get_release_version.py
37+
3038
- name: Enable corepack
3139
run: corepack enable
40+
3241
- name: Install Node.js 21 # Must be after corepack is enabled.
33-
uses: actions/setup-node@v6
42+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3443
with:
35-
node-version: '21'
36-
cache: 'yarn'
37-
cache-dependency-path: 'yarn.lock'
44+
node-version: 21
45+
cache: yarn
46+
cache-dependency-path: yarn.lock
47+
3848
- name: Install dependencies
3949
run: yarn install --frozen-lockfile
50+
4051
- name: Lint
4152
if: ${{ env.CI_LINT == 'true' }}
4253
run: yarn run lint:all
54+
4355
- name: Format
4456
if: ${{ env.CI_LINT == 'true' }}
4557
run: yarn run format:check
58+
4659
- name: Build TypeScript
4760
run: yarn run tsc
61+
4862
- name: Build
4963
run: yarn workspaces foreach -A run build:all
64+
5065
- name: Build Storybook
5166
run: yarn workspace @radapp.io/rad-components run build-storybook
67+
5268
- name: Run Tests
5369
if: ${{ env.CI_TEST == 'true' }}
5470
run: yarn run test:all
71+
5572
- name: Run E2E Tests
5673
if: ${{ env.CI_TEST == 'true' }}
5774
run: yarn run test:e2e
75+
5876
build-and-publish-container:
5977
name: Build and Publish Container
6078
runs-on: ubuntu-latest
6179
steps:
6280
- name: Checkout code
63-
uses: actions/checkout@v5
81+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
82+
6483
- name: Parse release version and set environment variables
6584
run: python ./.github/scripts/get_release_version.py
85+
6686
- name: Enable corepack
6787
run: corepack enable
88+
6889
- name: Install Node.js 21 # Must be after corepack is enabled.
69-
uses: actions/setup-node@v6
90+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
7091
with:
71-
node-version: '21'
72-
cache: 'yarn'
73-
cache-dependency-path: 'yarn.lock'
92+
node-version: 21
93+
cache: yarn
94+
cache-dependency-path: yarn.lock
95+
7496
- name: Install dependencies
7597
run: yarn install --frozen-lockfile
98+
7699
- name: Build TypeScript
77100
run: yarn run tsc
101+
78102
- name: Build Image
79103
run: yarn build:backend --config ../../app-config.yaml --config ../../app-config.dashboard.yaml
104+
80105
- name: Build Image
81106
run: yarn build-image
107+
82108
- name: Analyze Image
83109
uses: ./.github/actions/analyze-image
84110
with:
85111
image: ghcr.io/radius-project/dashboard:latest
112+
86113
- name: Login to ghcr.io
87114
if: ${{ env.CI_PUBLISH_LATEST == 'true' || env.CI_PUBLISH_RELEASE == 'true' }}
88-
uses: docker/login-action@v3
115+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
89116
with:
90117
registry: ghcr.io
91118
username: ${{ github.actor }}
92119
password: ${{ secrets.GITHUB_TOKEN }}
120+
93121
- name: Push Image to ghcr.io (push to main)
94122
if: ${{ env.CI_PUBLISH_LATEST == 'true' }}
95123
run: |
96124
docker push ghcr.io/radius-project/dashboard:latest
125+
97126
- name: Push Image to ghcr.io (push to tag)
98127
if: ${{ env.CI_PUBLISH_RELEASE == 'true' }}
99128
run: |

.github/workflows/devops-boards.yaml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
2+
---
13
name: Sync issue to Azure DevOps work item
24

35
on:
@@ -23,27 +25,31 @@ jobs:
2325
# Auth using Azure Service Principals was added as a part of v2.3
2426
# reference: https://github.com/danhellem/github-actions-issue-to-work-item/pull/143
2527
- name: Login to Azure
26-
uses: azure/login@v2
28+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
2729
with:
2830
client-id: ${{ vars.AZURE_SP_DEVOPS_SYNC_CLIENT_ID }}
2931
tenant-id: ${{ vars.AZURE_SP_DEVOPS_SYNC_TENANT_ID }}
3032
allow-no-subscriptions: true
33+
3134
- name: Get Azure DevOps token
3235
id: get_ado_token
33-
run:
36+
run: |
3437
# The resource ID for Azure DevOps is always 499b84ac-1321-427f-aa17-267ca6975798
3538
# https://learn.microsoft.com/azure/devops/integrate/get-started/authentication/service-principal-managed-identity
36-
echo "ADO_TOKEN=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)" >> $GITHUB_ENV
39+
ADO_TOKEN=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)
40+
echo "::add-mask::$ADO_TOKEN"
41+
echo "ADO_TOKEN=$ADO_TOKEN" >> $GITHUB_ENV
42+
3743
- name: Sync issue to Azure DevOps
38-
uses: danhellem/[email protected]
44+
uses: danhellem/github-actions-issue-to-work-item@8d0ead9b49a65aa66dac6949b1ff149d7ef8b4de # v2.5
3945
env:
4046
ado_token: ${{ env.ADO_TOKEN }}
41-
github_token: '${{ secrets.GH_RAD_CI_BOT_PAT }}'
42-
ado_organization: 'azure-octo'
43-
ado_project: 'Incubations'
47+
github_token: ${{ secrets.GH_RAD_CI_BOT_PAT }}
48+
ado_organization: azure-octo
49+
ado_project: Incubations
4450
ado_area_path: "Incubations\\Radius"
4551
ado_iteration_path: "Incubations\\Radius"
46-
ado_new_state: 'New'
47-
ado_active_state: 'Active'
48-
ado_close_state: 'Closed'
49-
ado_wit: 'GitHub Issue'
52+
ado_new_state: New
53+
ado_active_state: Active
54+
ado_close_state: Closed
55+
ado_wit: GitHub Issue

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"fix": "backstage-cli repo fix",
2626
"lint": "backstage-cli repo lint --since origin/main",
2727
"lint:all": "backstage-cli repo lint",
28-
"format:check": "prettier --check .",
29-
"format:write": "prettier --write .",
28+
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,mjs,cjs}\"",
29+
"format:write": "prettier --write \"**/*.{js,jsx,ts,tsx,mjs,cjs}\"",
3030
"new": "backstage-cli new --scope internal"
3131
},
3232
"workspaces": {

0 commit comments

Comments
 (0)