govuk_tech_docs 6.3.0 → 6.4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +15 -14
- data/.github/workflows/build-middleman-artifact.yaml +3 -3
- data/.github/workflows/check-documentation-updates.yaml +32 -0
- data/.github/workflows/check-gem-version.yaml +36 -0
- data/.github/workflows/npm-vulnerability-scanner.yaml +55 -0
- data/.github/workflows/pipeline.yaml +56 -0
- data/.github/workflows/publish-gem.yaml +70 -0
- data/.github/workflows/{deploy-to-pages.yaml → publish-github-pages.yaml} +4 -5
- data/.github/workflows/ruby-vulnerability-scanner.yaml +44 -0
- data/.github/workflows/test.yaml +9 -7
- data/.rspec +1 -0
- data/CHANGELOG.md +14 -0
- data/README.md +4 -1
- data/documentation/config/tech-docs.yml +1 -1
- data/documentation/source/configure_project/global_configuration/index.html.md.erb +9 -1
- data/lib/govuk_tech_docs/contribution_banner.rb +15 -3
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/source/layouts/_footer.erb +1 -1
- data/lib/source/layouts/_header.erb +1 -1
- data/lib/source/layouts/_service_navigation.erb +3 -1
- data/lib/source/layouts/core.erb +2 -4
- data/lib/tasks/lint.rake +87 -13
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +2 -5
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +2 -5
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/_index.import.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_mixin.scss +1 -5
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_mixin.scss +7 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_mixin.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_mixin.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_feedback.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_mixin.scss +48 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +1 -4
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +1 -4
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +1 -5
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_mixin.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_generic-header.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_mixin.scss +140 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_mixin.scss +9 -65
- data/node_modules/govuk-frontend/dist/govuk/components/input/_mixin.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_index.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_language-navigation.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_mixin.scss +68 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_mixin.scss +8 -7
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_mixin.scss +46 -12
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_mixin.scss +7 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_mixin.scss +0 -7
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_mixin.scss +55 -9
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.mixin.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.mixin.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +16 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +1 -1
- data/package-lock.json +183 -582
- data/package.json +3 -3
- metadata +20 -4
- data/.github/workflows/dependency-review.yaml +0 -25
- data/.github/workflows/publish.yaml +0 -83
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f326d15a8bd80fdec03049e06969fa49df12a72e1379c0638c32b6438553491
|
|
4
|
+
data.tar.gz: a51886d4182c8938ae188075568fd92028bf1899b410d0caaff864612ec17763
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48c680742a7eb673015b3d4c0d0e84d11e2f3bd220ba99a50aace843c110d8eb756ec3ed599242e9290e2f9ab407090115961f685407d44edd6545b4186f2d87
|
|
7
|
+
data.tar.gz: 223a5bf9bfa71d7977a83d5fc1c8f45d3aec88e0f7270688c0d03d7f6eb1952aa540a2424fe938992b8a0c455c52a37b3d437500fdec3deffb4a2ecc049b4b8a
|
data/.github/dependabot.yml
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
-
# package ecosystems to update and where the package manifests are located.
|
|
3
|
-
# Please see the documentation for all configuration options:
|
|
4
|
-
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
-
|
|
6
1
|
version: 2
|
|
7
2
|
updates:
|
|
8
3
|
# 1. Update Ruby dependencies (Gemfile/gemspec) in the root
|
|
@@ -12,9 +7,11 @@ updates:
|
|
|
12
7
|
interval: "weekly"
|
|
13
8
|
day: "monday"
|
|
14
9
|
time: "06:00"
|
|
10
|
+
# Essential for gem projects without a Gemfile.lock:
|
|
11
|
+
versioning-strategy: "increase"
|
|
15
12
|
commit-message:
|
|
16
13
|
prefix: chore
|
|
17
|
-
open-pull-requests-limit:
|
|
14
|
+
open-pull-requests-limit: 5
|
|
18
15
|
groups:
|
|
19
16
|
prod-safe-updates:
|
|
20
17
|
dependency-type: "production"
|
|
@@ -23,9 +20,15 @@ updates:
|
|
|
23
20
|
update-types:
|
|
24
21
|
- "minor"
|
|
25
22
|
- "patch"
|
|
23
|
+
dev-safe-updates:
|
|
24
|
+
dependency-type: "development"
|
|
25
|
+
patterns:
|
|
26
|
+
- "*"
|
|
27
|
+
update-types:
|
|
28
|
+
- "minor"
|
|
29
|
+
- "patch"
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
# 2. Update GitHub Actions (keeps your CI workflows secure)
|
|
31
|
+
# 2. Update GitHub Actions
|
|
29
32
|
- package-ecosystem: "github-actions"
|
|
30
33
|
directory: "/"
|
|
31
34
|
schedule:
|
|
@@ -39,15 +42,15 @@ updates:
|
|
|
39
42
|
patterns:
|
|
40
43
|
- "*"
|
|
41
44
|
|
|
45
|
+
# 3. Update npm dependencies
|
|
42
46
|
- package-ecosystem: "npm"
|
|
43
|
-
directory: "/"
|
|
47
|
+
directory: "/"
|
|
44
48
|
schedule:
|
|
45
49
|
interval: "weekly"
|
|
46
50
|
day: "monday"
|
|
47
51
|
time: "06:00"
|
|
48
|
-
open-pull-requests-limit:
|
|
52
|
+
open-pull-requests-limit: 5
|
|
49
53
|
groups:
|
|
50
|
-
# Group all "development" dependencies (linters, test runners, etc.)
|
|
51
54
|
dev-dependencies:
|
|
52
55
|
dependency-type: "development"
|
|
53
56
|
patterns:
|
|
@@ -55,12 +58,10 @@ updates:
|
|
|
55
58
|
update-types:
|
|
56
59
|
- "patch"
|
|
57
60
|
- "minor"
|
|
58
|
-
# Group all "production" dependencies (react, express, etc.)
|
|
59
|
-
# but ONLY for minor/patch versions to avoid breaking changes
|
|
60
61
|
prod-safe-updates:
|
|
61
62
|
dependency-type: "production"
|
|
62
63
|
patterns:
|
|
63
64
|
- "*"
|
|
64
65
|
update-types:
|
|
65
66
|
- "patch"
|
|
66
|
-
- "minor"
|
|
67
|
+
- "minor"
|
|
@@ -15,15 +15,15 @@ jobs:
|
|
|
15
15
|
working-directory: documentation
|
|
16
16
|
steps:
|
|
17
17
|
- name: Checkout repository
|
|
18
|
-
uses: actions/checkout@
|
|
18
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
19
19
|
with:
|
|
20
20
|
fetch-depth: 0
|
|
21
21
|
- name: Setup Node
|
|
22
|
-
uses: actions/setup-node@
|
|
22
|
+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
23
23
|
with:
|
|
24
24
|
node-version-file: 'documentation/.nvmrc'
|
|
25
25
|
- name: Setup Ruby
|
|
26
|
-
uses: ruby/setup-ruby@
|
|
26
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
27
27
|
with:
|
|
28
28
|
bundler-cache: true
|
|
29
29
|
working-directory: documentation
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: check-documentation-updates
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
outputs:
|
|
6
|
+
documentation-updated:
|
|
7
|
+
value: ${{ jobs.check-documentation-updates.outputs.documentation-updated }}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
check-documentation-updates:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
outputs:
|
|
14
|
+
documentation-updated: ${{ steps.documentation_updated.outputs.documentation-updated }}
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
18
|
+
with:
|
|
19
|
+
show-progress: false
|
|
20
|
+
|
|
21
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
22
|
+
with:
|
|
23
|
+
ruby-version: '3'
|
|
24
|
+
|
|
25
|
+
- name: Documentation updated
|
|
26
|
+
id: documentation_updated
|
|
27
|
+
run: |
|
|
28
|
+
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^documentation/'; then
|
|
29
|
+
echo "documentation-updated=true" >> $GITHUB_OUTPUT
|
|
30
|
+
else
|
|
31
|
+
echo "documentation-updated=false" >> $GITHUB_OUTPUT
|
|
32
|
+
fi
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: check-gem-version
|
|
2
|
+
on:
|
|
3
|
+
workflow_call:
|
|
4
|
+
outputs:
|
|
5
|
+
version-changed:
|
|
6
|
+
value: ${{ jobs.check-gem-version.outputs.version-changed }}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
check-gem-version:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
outputs:
|
|
13
|
+
version-changed: ${{ steps.gem_version.outputs.version-changed }}
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
17
|
+
with:
|
|
18
|
+
show-progress: false
|
|
19
|
+
|
|
20
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
21
|
+
with:
|
|
22
|
+
ruby-version: '3'
|
|
23
|
+
|
|
24
|
+
- name: Gem version changed
|
|
25
|
+
id: gem_version
|
|
26
|
+
run: |
|
|
27
|
+
gem_version=$(ruby -r rubygems -e "puts Gem::Specification::load('govuk_tech_docs.gemspec').version")
|
|
28
|
+
echo "gem_version=$gem_version" >> "$GITHUB_OUTPUT"
|
|
29
|
+
|
|
30
|
+
if git fetch origin "refs/tags/v$gem_version" >/dev/null 2>&1
|
|
31
|
+
then
|
|
32
|
+
echo "Tag 'v$gem_version' already exists"
|
|
33
|
+
echo "version-changed=false" >> "$GITHUB_OUTPUT"
|
|
34
|
+
else
|
|
35
|
+
echo "version-changed=true" >> "$GITHUB_OUTPUT"
|
|
36
|
+
fi
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: NPM Audit Security Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
npm-audit:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Code
|
|
15
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
|
16
|
+
|
|
17
|
+
- name: Setup Node.js
|
|
18
|
+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
|
|
19
|
+
with:
|
|
20
|
+
node-version: '20'
|
|
21
|
+
cache: 'npm'
|
|
22
|
+
|
|
23
|
+
- name: Run NPM Audit & Generate Summary
|
|
24
|
+
run: |
|
|
25
|
+
# 1. Run npm audit in JSON mode to capture raw audit metadata
|
|
26
|
+
AUDIT_JSON=$(npm audit --audit-level=high --json 2>/dev/null) || true
|
|
27
|
+
|
|
28
|
+
# 2. Extract counts using node's built-in JSON parser
|
|
29
|
+
CRITICAL_COUNT=$(echo "$AUDIT_JSON" | node -e "let d=''; process.stdin.on('data', c => d += c); process.stdin.on('end', () => { try { console.log(JSON.parse(d).metadata.vulnerabilities.critical || 0) } catch { console.log(0) } })")
|
|
30
|
+
HIGH_COUNT=$(echo "$AUDIT_JSON" | node -e "let d=''; process.stdin.on('data', c => d += c); process.stdin.on('end', () => { try { console.log(JSON.parse(d).metadata.vulnerabilities.high || 0) } catch { console.log(0) } })")
|
|
31
|
+
|
|
32
|
+
# 3. Build GitHub Job Summary Markdown
|
|
33
|
+
echo "## 🛡️ NPM Dependency Audit Summary" >> $GITHUB_STEP_SUMMARY
|
|
34
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
35
|
+
|
|
36
|
+
if [ "$CRITICAL_COUNT" -eq 0 ] && [ "$HIGH_COUNT" -eq 0 ]; then
|
|
37
|
+
echo "✅ **No high or critical vulnerabilities found!** All JS packages passed security checks." >> $GITHUB_STEP_SUMMARY
|
|
38
|
+
else
|
|
39
|
+
echo "⚠️ **High/Critical Vulnerabilities Detected in npm Dependencies**" >> $GITHUB_STEP_SUMMARY
|
|
40
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
41
|
+
echo "| Vulnerability Severity | Total Count |" >> $GITHUB_STEP_SUMMARY
|
|
42
|
+
echo "| :--- | :--- |" >> $GITHUB_STEP_SUMMARY
|
|
43
|
+
echo "| 🔴 **Critical** | $CRITICAL_COUNT \vert{}" >> $GITHUB_STEP_SUMMARY
|
|
44
|
+
echo "| 🟠 **High** | $HIGH_COUNT \vert{}" >> $GITHUB_STEP_SUMMARY
|
|
45
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
46
|
+
echo "### Detailed Audit Report" >> $GITHUB_STEP_SUMMARY
|
|
47
|
+
echo '```text' >> $GITHUB_STEP_SUMMARY
|
|
48
|
+
# Output human-readable audit text into the summary block
|
|
49
|
+
npm audit --audit-level=high 2>/dev/null || true
|
|
50
|
+
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
51
|
+
|
|
52
|
+
# 4. Fail the workflow step
|
|
53
|
+
echo "::error::npm audit detected $CRITICAL_COUNT critical and $HIGH_COUNT high vulnerabilities."
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: pipeline
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches: [ "main"]
|
|
5
|
+
push:
|
|
6
|
+
branches: [ "main"]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
npm-vulnerability-scanner:
|
|
10
|
+
uses: ./.github/workflows/npm-vulnerability-scanner.yaml
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
ruby-vulnerability-scanner:
|
|
15
|
+
needs: npm-vulnerability-scanner
|
|
16
|
+
uses: ./.github/workflows/ruby-vulnerability-scanner.yaml
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
test:
|
|
21
|
+
needs: ruby-vulnerability-scanner
|
|
22
|
+
uses: ./.github/workflows/test.yaml
|
|
23
|
+
permissions:
|
|
24
|
+
contents: read # Allows the action to check out your repository code
|
|
25
|
+
pull-requests: write # Allows the action to comment on or update the Dependabot PR
|
|
26
|
+
statuses: write # Allows the action to post pass/fail build statuses
|
|
27
|
+
|
|
28
|
+
check-gem-version:
|
|
29
|
+
needs: test
|
|
30
|
+
uses: ./.github/workflows/check-gem-version.yaml
|
|
31
|
+
|
|
32
|
+
publish-gem:
|
|
33
|
+
needs: check-gem-version
|
|
34
|
+
if: github.event_name == 'push' && needs.check-gem-version.outputs.version-changed == 'true'
|
|
35
|
+
with:
|
|
36
|
+
new-gem-version: true
|
|
37
|
+
uses: ./.github/workflows/publish-gem.yaml
|
|
38
|
+
permissions:
|
|
39
|
+
contents: write # needed to be able to tag the release
|
|
40
|
+
|
|
41
|
+
check-documentation-updates:
|
|
42
|
+
needs: publish-gem
|
|
43
|
+
if: |
|
|
44
|
+
github.event_name == 'push' &&
|
|
45
|
+
always() &&
|
|
46
|
+
(needs.publish-gem.result == 'success' || needs.publish-gem.result == 'skipped')
|
|
47
|
+
uses: ./.github/workflows/check-documentation-updates.yaml
|
|
48
|
+
|
|
49
|
+
publish-github-pages:
|
|
50
|
+
needs: check-documentation-updates
|
|
51
|
+
if: github.event_name == 'push' && needs.check-documentation-updates.outputs.documentation-updated == 'true'
|
|
52
|
+
uses: ./.github/workflows/publish-github-pages.yaml
|
|
53
|
+
permissions:
|
|
54
|
+
contents: read
|
|
55
|
+
pages: write
|
|
56
|
+
id-token: write
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
inputs:
|
|
6
|
+
new-gem-version:
|
|
7
|
+
default: false
|
|
8
|
+
type: boolean
|
|
9
|
+
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
inputs:
|
|
12
|
+
new-gem-version:
|
|
13
|
+
description: 'Force publish gem?'
|
|
14
|
+
default: false
|
|
15
|
+
type: boolean
|
|
16
|
+
|
|
17
|
+
concurrency: rubygems
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
deploy:
|
|
21
|
+
name: Publish Ruby Gem
|
|
22
|
+
environment: rubygems
|
|
23
|
+
permissions:
|
|
24
|
+
contents: write # needed to be able to tag the release
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
if: inputs.new-gem-version
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
30
|
+
with:
|
|
31
|
+
show-progress: false
|
|
32
|
+
|
|
33
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
34
|
+
with:
|
|
35
|
+
node-version-file: '.nvmrc'
|
|
36
|
+
cache: 'npm'
|
|
37
|
+
|
|
38
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: '3'
|
|
41
|
+
bundler-cache: true
|
|
42
|
+
|
|
43
|
+
- name: Verify Secret Presence
|
|
44
|
+
run: |
|
|
45
|
+
if [ -z "${{ secrets.RUBYGEMS_API_KEY }}" ]; then
|
|
46
|
+
echo "Error: Secret is empty or missing from this context!"
|
|
47
|
+
exit 1
|
|
48
|
+
else
|
|
49
|
+
echo "Secret is populated."
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
- name: Publish
|
|
53
|
+
env:
|
|
54
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
55
|
+
run: |
|
|
56
|
+
mkdir -p ~/.gem
|
|
57
|
+
|
|
58
|
+
cat << EOF > ~/.gem/credentials
|
|
59
|
+
---
|
|
60
|
+
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
|
61
|
+
EOF
|
|
62
|
+
|
|
63
|
+
chmod 0600 ~/.gem/credentials
|
|
64
|
+
|
|
65
|
+
# tag will be associated with github-actions bot user, see
|
|
66
|
+
# https://github.community/t/github-actions-bot-email-address/17204
|
|
67
|
+
git config user.name "github-actions[bot]"
|
|
68
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
69
|
+
|
|
70
|
+
bundle exec rake release
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: Publish GitHub pages
|
|
2
2
|
on:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
paths: ['documentation/**']
|
|
3
|
+
workflow_call:
|
|
4
|
+
|
|
6
5
|
|
|
7
6
|
permissions:
|
|
8
7
|
contents: read
|
|
@@ -36,4 +35,4 @@ jobs:
|
|
|
36
35
|
path: "build"
|
|
37
36
|
- name: Deploy to GitHub Pages
|
|
38
37
|
id: deployment
|
|
39
|
-
uses: actions/deploy-pages@
|
|
38
|
+
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Ruby vulnerability scanner
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
bundler-audit:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Code
|
|
15
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
|
16
|
+
|
|
17
|
+
- name: Setup Ruby
|
|
18
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b
|
|
19
|
+
with:
|
|
20
|
+
ruby-version: '3.3'
|
|
21
|
+
bundler-cache: true
|
|
22
|
+
|
|
23
|
+
- name: Run Audit Check
|
|
24
|
+
run: |
|
|
25
|
+
gem install bundler-audit
|
|
26
|
+
|
|
27
|
+
# Run audit and save output to file (preventing immediate job failure via || true)
|
|
28
|
+
bundle-audit check --update > audit_results.txt || AUDIT_EXIT_CODE=$?
|
|
29
|
+
|
|
30
|
+
echo "## 🛡️ Ruby Dependency Audit Summary" >> $GITHUB_STEP_SUMMARY
|
|
31
|
+
|
|
32
|
+
if [ -z "$AUDIT_EXIT_CODE" ]; then
|
|
33
|
+
echo "::notice::No vulnerabilities found in Ruby dependencies."
|
|
34
|
+
echo "✅ **No vulnerabilities found!** All resolved gems from your `.gemspec` passed security checks." >> $GITHUB_STEP_SUMMARY
|
|
35
|
+
else
|
|
36
|
+
echo "⚠️ **Vulnerabilities Detected in Ruby Dependencies**" >> $GITHUB_STEP_SUMMARY
|
|
37
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
38
|
+
echo '```text' >> $GITHUB_STEP_SUMMARY
|
|
39
|
+
cat audit_results.txt >> $GITHUB_STEP_SUMMARY
|
|
40
|
+
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
41
|
+
|
|
42
|
+
# Fail the step if vulnerabilities were found
|
|
43
|
+
exit $AUDIT_EXIT_CODE
|
|
44
|
+
fi
|
data/.github/workflows/test.yaml
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
name: Test
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
branches: [ "main" ]
|
|
6
|
-
push:
|
|
7
|
-
branches: [ "main" ]
|
|
4
|
+
workflow_call:
|
|
8
5
|
workflow_dispatch:
|
|
9
6
|
|
|
10
7
|
permissions:
|
|
@@ -12,26 +9,31 @@ permissions:
|
|
|
12
9
|
pull-requests: write # Allows the action to comment on or update the Dependabot PR
|
|
13
10
|
statuses: write # Allows the action to post pass/fail build statuses
|
|
14
11
|
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
15
16
|
jobs:
|
|
16
17
|
test:
|
|
17
18
|
name: Test
|
|
18
19
|
runs-on: ubuntu-latest
|
|
19
20
|
|
|
20
21
|
strategy:
|
|
22
|
+
fail-fast: false
|
|
21
23
|
matrix:
|
|
22
24
|
ruby: ['3.3', '3.4', '4.0']
|
|
23
25
|
|
|
24
26
|
steps:
|
|
25
|
-
- uses: actions/checkout@
|
|
27
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
26
28
|
with:
|
|
27
29
|
show-progress: false
|
|
28
30
|
|
|
29
|
-
- uses: actions/setup-node@
|
|
31
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
30
32
|
with:
|
|
31
33
|
node-version-file: '.nvmrc'
|
|
32
34
|
cache: 'npm'
|
|
33
35
|
|
|
34
|
-
- uses: ruby/setup-ruby@
|
|
36
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
35
37
|
with:
|
|
36
38
|
ruby-version: ${{ matrix.ruby }}
|
|
37
39
|
bundler-cache: true
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## Unreleased changes
|
|
2
|
+
|
|
3
|
+
## 6.4.1
|
|
4
|
+
|
|
5
|
+
- Bugfix: [Issue 283](https://github.com/alphagov/tech-docs-gem/issues/283) - correctly read report issue url (backwards compatible)
|
|
6
|
+
- Update: [Issue 543](https://github.com/alphagov/tech-docs-gem/issues/543) - allow full git urls as well as just repository name for report issue url
|
|
7
|
+
- [PR 542](https://github.com/alphagov/tech-docs-gem/pull/542) to improve vale linter handling and output when using rake task
|
|
8
|
+
|
|
9
|
+
## 6.4.0.beta
|
|
10
|
+
|
|
11
|
+
- [Remove govuk wrapper class](https://github.com/alphagov/tech-docs-gem/pull/530) that introduced extra padding
|
|
12
|
+
- Update[ template html syntax](https://github.com/alphagov/tech-docs-gem/pull/520) to more closely match gov.uk design template
|
|
13
|
+
- bump govuk-frontend from [6.2.0 to 6.3.0](https://github.com/alphagov/tech-docs-gem/pull/517)
|
|
14
|
+
|
|
1
15
|
## 6.3.0
|
|
2
16
|
|
|
3
17
|
- Bugfix [issue 258](https://github.com/alphagov/tech-docs-template/issues/258) - page layout structure to remove whitespace on short pages ([pull request 513](https://github.com/alphagov/tech-docs-gem/pull/513))
|
data/README.md
CHANGED
|
@@ -45,6 +45,9 @@ The linting job can take the following optional parameters:
|
|
|
45
45
|
| `clean_build` | If true runs `bundle exec middleman build` to create a clean build. | 'true' |
|
|
46
46
|
| `full_output` | If true the full report is printed to the console, otherwise only the summary is displayed. | 'true' |
|
|
47
47
|
|
|
48
|
+
|
|
49
|
+
If running the linter causes timeouts or crashes, you can use `bundle exec tech_docs_jobs lint:debug`. You should use this locally, not as part of a pipeline.
|
|
50
|
+
|
|
48
51
|
## GOV.UK frontend
|
|
49
52
|
|
|
50
53
|
This gem uses [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend), part of
|
|
@@ -163,7 +166,7 @@ the [Tech Docs template documentation on previewing your documentation](https://
|
|
|
163
166
|
You can run the Ruby test suite with the following command:
|
|
164
167
|
|
|
165
168
|
```shell
|
|
166
|
-
bundle exec
|
|
169
|
+
bundle exec rake spec
|
|
167
170
|
```
|
|
168
171
|
|
|
169
172
|
To test a specific file include the filepath after `rspec`.
|
|
@@ -29,7 +29,7 @@ collapsible_nav: true
|
|
|
29
29
|
|
|
30
30
|
# Show links to contribute on GitHub
|
|
31
31
|
show_contribution_banner: true
|
|
32
|
-
github_repo: https://github.com/alphagov/tech-docs-gem
|
|
32
|
+
github_repo: https://github.com/alphagov/tech-docs-gem
|
|
33
33
|
|
|
34
34
|
# Enable search
|
|
35
35
|
enable_search: true
|
|
@@ -211,12 +211,20 @@ show_contribution_banner: true
|
|
|
211
211
|
|
|
212
212
|
### github_repo
|
|
213
213
|
|
|
214
|
-
Your documentation project's GitHub repository. You must
|
|
214
|
+
Your documentation project's GitHub repository. You must configure this if you have enabled [show_contribution_banner].
|
|
215
|
+
|
|
216
|
+
Set this to either the repository's `owner/name` or its full GitHub URL. Link to the repository itself, rather than a file or directory, because the contribution banner builds its links relative to this URL.
|
|
215
217
|
|
|
216
218
|
```yaml
|
|
217
219
|
github_repo: alphagov/example-repo
|
|
218
220
|
```
|
|
219
221
|
|
|
222
|
+
You can also use the full URL:
|
|
223
|
+
|
|
224
|
+
```yaml
|
|
225
|
+
github_repo: https://github.com/alphagov/example-repo
|
|
226
|
+
```
|
|
227
|
+
|
|
220
228
|
### github_branch
|
|
221
229
|
|
|
222
230
|
Your project's GitHub default branch name. You can change this if your default branch is not named main.
|
|
@@ -19,7 +19,8 @@ module GovukTechDocs
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def report_issue_url
|
|
22
|
-
url = config[:source_urls]&.[](:report_issue_url)
|
|
22
|
+
url = config[:tech_docs][:source_urls]&.[](:report_issue_url)
|
|
23
|
+
url ||= config[:source_urls]&.[](:report_issue_url)
|
|
23
24
|
params = {
|
|
24
25
|
body: "Problem with '#{current_page.data.title}' (#{config[:tech_docs][:host]}#{current_page.url})",
|
|
25
26
|
}
|
|
@@ -35,11 +36,22 @@ module GovukTechDocs
|
|
|
35
36
|
end
|
|
36
37
|
|
|
37
38
|
def repo_url
|
|
38
|
-
|
|
39
|
+
github_repo = config[:tech_docs][:github_repo]
|
|
40
|
+
if github_repo.nil? || github_repo.empty?
|
|
41
|
+
raise ArgumentError, "github_repo value not found in config/tech-docs.yml"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
repo_url = if github_repo.match?(%r{\Ahttps://github\.com/}i)
|
|
45
|
+
github_repo
|
|
46
|
+
else
|
|
47
|
+
"https://github.com/#{github_repo}"
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
repo_url.delete_suffix("/")
|
|
39
51
|
end
|
|
40
52
|
|
|
41
53
|
def repo_branch
|
|
42
|
-
config[:tech_docs][:github_branch] || "master"
|
|
54
|
+
config[:tech_docs][:github_branch] || "master"
|
|
43
55
|
end
|
|
44
56
|
|
|
45
57
|
private
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="govuk-footer app-footer"
|
|
1
|
+
<div class="govuk-footer app-footer">
|
|
2
2
|
<% if config[:tech_docs][:show_govuk_logo] %>
|
|
3
3
|
<svg focusable="false" role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 60" height="30" width="32" fill="currentcolor" class="govuk-footer__crown">
|
|
4
4
|
<g>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="govuk-header app-header"
|
|
1
|
+
<div class="govuk-header app-header">
|
|
2
2
|
<div class="govuk-header__container govuk-header__container--full-width">
|
|
3
3
|
<div class="govuk-header__logo">
|
|
4
4
|
<% if config[:tech_docs][:service_link] %>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
<div class="govuk-service-navigation app-pane__navigation" data-module="govuk-service-navigation">
|
|
2
|
+
<div class="govuk-width-container">
|
|
2
3
|
<div class="govuk-service-navigation__container">
|
|
3
4
|
<nav aria-label="Menu" class="govuk-service-navigation__wrapper">
|
|
4
5
|
<button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="navigation" hidden aria-hidden="true">
|
|
@@ -20,3 +21,4 @@
|
|
|
20
21
|
</nav>
|
|
21
22
|
</div>
|
|
22
23
|
</div>
|
|
24
|
+
</div>
|
data/lib/source/layouts/core.erb
CHANGED
|
@@ -50,13 +50,11 @@
|
|
|
50
50
|
|
|
51
51
|
<body class="govuk-template__body">
|
|
52
52
|
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
|
|
53
|
-
<header class="govuk-template__header app-header"
|
|
53
|
+
<header class="govuk-template__header app-header">
|
|
54
54
|
<%= partial 'layouts/header' %>
|
|
55
55
|
</header>
|
|
56
56
|
<% if config[:tech_docs][:header_links] %>
|
|
57
|
-
<div class="govuk-service-navigation app-pane__navigation" data-module="govuk-service-navigation">
|
|
58
57
|
<%= partial 'layouts/service_navigation' %>
|
|
59
|
-
</div>
|
|
60
58
|
<% end %>
|
|
61
59
|
|
|
62
60
|
|
|
@@ -87,7 +85,7 @@
|
|
|
87
85
|
<% end %>
|
|
88
86
|
|
|
89
87
|
<div class="app-pane__content toc-open-disabled" aria-label="Content">
|
|
90
|
-
<main id="content" class="
|
|
88
|
+
<main id="content" class="technical-documentation"<% if config[:tech_docs][:enable_anchored_headings] != false %> data-module="anchored-headings"<% end %>>
|
|
91
89
|
<%= yield %>
|
|
92
90
|
<%= partial "layouts/page_review" %>
|
|
93
91
|
</main>
|