Skip to content

Commit 4fb6801

Browse files
ci(workflows): pin actions to full sha (#34)
* ci(workflows): pin actions to full sha Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> * ci(dependabot): add configuration for GitHub Actions updates Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> * fix: issue template path Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> * fix: format script block for Azure DevOps token retrieval Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> --------- Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
1 parent 72ecfc8 commit 4fb6801

File tree

6 files changed

+96
-58
lines changed

6 files changed

+96
-58
lines changed
File renamed without changes.

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
---
5+
version: 2
6+
7+
updates:
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: weekly
12+
commit-message:
13+
prefix: ci
14+
include: scope
15+
groups:
16+
all:
17+
patterns:
18+
- "*"

.github/workflows/issues.yml

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/github-actions-issue-to-work-item@v2.3
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

.github/workflows/main.yml

Lines changed: 18 additions & 12 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: Radius Website
24

35
on:
@@ -16,51 +18,55 @@ jobs:
1618
if: github.event.action != 'closed'
1719
runs-on: ubuntu-latest
1820
env:
19-
GOVER: '^1.17'
21+
GOVER: "^1.17"
2022
HUGO_ENV: production
21-
SWA_BASE: 'brave-pond-00b49761e'
23+
SWA_BASE: brave-pond-00b49761e
2224
steps:
2325
- name: Checkout website repo
24-
uses: actions/checkout@v2
26+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
27+
2528
- name: Setup Hugo
26-
uses: peaceiris/actions-hugo@v2.5.0
29+
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
2730
with:
2831
hugo-version: 0.102.3
2932
extended: true
33+
3034
- name: Build Hugo Site
3135
run: |
3236
if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then
3337
STAGING_URL="https://${SWA_BASE}-${{github.event.number}}.3.azurestaticapps.net/"
3438
fi
3539
hugo ${STAGING_URL+-b "$STAGING_URL"}
40+
3641
- name: Upload Hugo artifacts
37-
uses: actions/upload-artifact@v4
42+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
3843
with:
3944
name: hugo_build
4045
path: ./public/
4146
if-no-files-found: error
42-
47+
4348
deploy:
4449
name: Deploy Hugo Website
45-
needs: ['build']
50+
needs: ["build"]
4651
runs-on: ubuntu-latest
4752
environment:
4853
name: latest
4954
url: https://radapp.io
5055
steps:
5156
- name: Download Hugo artifacts
52-
uses: actions/download-artifact@v4.1.7
57+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
5358
with:
5459
name: hugo_build
5560
path: site/
61+
5662
- name: Deploy static web app
57-
uses: Azure/static-web-apps-deploy@v1
63+
uses: Azure/static-web-apps-deploy@4d27395796ac319302594769cfe812bd207490b1 # v1
5864
with:
5965
azure_static_web_apps_api_token: ${{ secrets.SWA_TOKEN }}
6066
skip_deploy_on_missing_secrets: true
6167
repo_token: ${{ secrets.GITHUB_TOKEN }}
62-
action: "upload"
63-
app_location: "site/"
64-
api_location: "site/"
68+
action: upload
69+
app_location: site/
70+
api_location: site/
6571
output_location: ""
6672
skip_app_build: true

.github/workflows/spellcheck.yaml

Lines changed: 42 additions & 35 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: Spellcheck
24

35
on:
@@ -13,7 +15,7 @@ on:
1315
- edge
1416

1517
env:
16-
ACTION_LINK: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
18+
ACTION_LINK: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
1719

1820
concurrency:
1921
group: spellcheck-${{ github.ref }}-${{ github.event.pull_request.number || github.sha }}
@@ -23,37 +25,42 @@ jobs:
2325
name: Spellcheck
2426
runs-on: ubuntu-latest
2527
steps:
26-
- name: Checkout docs
27-
uses: actions/checkout@v4
28-
- name: Spellcheck
29-
uses: rojopolis/spellcheck-github-actions@0.36.0
30-
with:
31-
config_path: .github/config/.pyspelling.yml
32-
- name: Post GitHub workkflow output on failure
33-
if: failure()
34-
run: |
35-
echo "## :x: Spellcheck Failed" >> $GITHUB_STEP_SUMMARY
36-
echo "There are spelling errors in your PR. Visit [the workflow output](${{ env.ACTION_LINK }}) to see what words are failing." >> $GITHUB_STEP_SUMMARY
37-
echo "### Adding new words" >> $GITHUB_STEP_SUMMARY
38-
echo "If you are adding a new custom word refer to the [docs guide](https://docs.radapp.io/contributing/docs/#spelling)" >> $GITHUB_STEP_SUMMARY
39-
- name: Post GitHub workflow output on success
40-
run: |
41-
echo "## :white_check_mark: Spellcheck Passed" >> $GITHUB_STEP_SUMMARY
42-
echo "There are no spelling errors in your PR." >> $GITHUB_STEP_SUMMARY
43-
- name: Post GitHub comment on failure
44-
if: failure()
45-
uses: marocchino/sticky-pull-request-comment@v2
46-
with:
47-
header: spellcheck
48-
recreate: true
49-
message: |
50-
## :x: Spellcheck Failed
51-
There are spelling errors in your PR. Visit [the workflow output](${{ env.ACTION_LINK }}) to see what words are failing.
52-
### Adding new words
53-
If you are adding a new custom word refer to the [docs guide](https://docs.radapp.io/contributing/docs/#spelling)
54-
- name: Clear GitHub comment on success
55-
uses: marocchino/sticky-pull-request-comment@v2
56-
continue-on-error: true
57-
with:
58-
header: spellcheck
59-
delete: true
28+
- name: Checkout docs
29+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
30+
31+
- name: Spellcheck
32+
uses: rojopolis/spellcheck-github-actions@6f2326b663e2dbab920da0fc4144b9f3202434ba # 0.54.0
33+
with:
34+
config_path: .github/config/.pyspelling.yml
35+
36+
- name: Post GitHub workkflow output on failure
37+
if: failure()
38+
run: |
39+
echo "## :x: Spellcheck Failed" >> $GITHUB_STEP_SUMMARY
40+
echo "There are spelling errors in your PR. Visit [the workflow output](${{ env.ACTION_LINK }}) to see what words are failing." >> $GITHUB_STEP_SUMMARY
41+
echo "### Adding new words" >> $GITHUB_STEP_SUMMARY
42+
echo "If you are adding a new custom word refer to the [docs guide](https://docs.radapp.io/contributing/docs/#spelling)" >> $GITHUB_STEP_SUMMARY
43+
44+
- name: Post GitHub workflow output on success
45+
run: |
46+
echo "## :white_check_mark: Spellcheck Passed" >> $GITHUB_STEP_SUMMARY
47+
echo "There are no spelling errors in your PR." >> $GITHUB_STEP_SUMMARY
48+
49+
- name: Post GitHub comment on failure
50+
if: failure()
51+
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
52+
with:
53+
header: spellcheck
54+
recreate: true
55+
message: |
56+
## :x: Spellcheck Failed
57+
There are spelling errors in your PR. Visit [the workflow output](${{ env.ACTION_LINK }}) to see what words are failing.
58+
### Adding new words
59+
If you are adding a new custom word refer to the [docs guide](https://docs.radapp.io/contributing/docs/#spelling)
60+
61+
- name: Clear GitHub comment on success
62+
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
63+
continue-on-error: true
64+
with:
65+
header: spellcheck
66+
delete: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**.lock
22
_gen/
33
.DS_Store
4+
public/*

0 commit comments

Comments
 (0)