Skip to content

Commit 1d7dd4d

Browse files
Merge pull request #1 from step-security/release
feat: onboarding github-action-markdown-cli
2 parents b4f0941 + ff9f8e0 commit 1d7dd4d

23 files changed

Lines changed: 1093 additions & 1 deletion

‎.dockerignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!markdownlint-problem-matcher.json
2+
!entrypoint.sh
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release GitHub Actions
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the release"
8+
required: true
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
release:
15+
permissions:
16+
actions: read
17+
id-token: write
18+
contents: write
19+
20+
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
21+
with:
22+
tag: "${{ github.event.inputs.tag }}"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: NPM Audit Fix Run
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
force:
7+
description: "Use --force flag for npm audit fix?"
8+
required: true
9+
type: boolean
10+
base_branch:
11+
description: "Specify a base branch"
12+
required: false
13+
default: "main"
14+
schedule:
15+
- cron: "0 0 * * 1"
16+
17+
jobs:
18+
audit-fix:
19+
uses: step-security/reusable-workflows/.github/workflows/audit_fix.yml@v1
20+
with:
21+
force: ${{ inputs.force || false }}
22+
base_branch: ${{ inputs.base_branch || 'main' }}
23+
24+
permissions:
25+
contents: write
26+
pull-requests: write
27+
packages: read
28+
issues: write
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Auto Cherry-Pick from Upstream
2+
3+
on:
4+
workflow_run:
5+
workflows: [ "Release GitHub Actions" ]
6+
types:
7+
- completed
8+
9+
workflow_dispatch:
10+
inputs:
11+
base_branch:
12+
description: "Base branch to create the PR against"
13+
required: true
14+
default: "main"
15+
mode:
16+
description: "Run mode: cherry-pick or verify"
17+
required: false
18+
default: "cherry-pick"
19+
20+
pull_request:
21+
types: [ opened, synchronize, labeled ]
22+
23+
permissions:
24+
contents: write
25+
pull-requests: write
26+
packages: read
27+
issues: write
28+
29+
jobs:
30+
cherry-pick:
31+
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')
32+
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@v1
33+
with:
34+
original-owner: "nosborn"
35+
repo-name: "github-action-markdown-cli"
36+
base_branch: ${{ inputs.base_branch || 'main' }}
37+
mode: ${{ github.event_name == 'pull_request' && 'verify' || inputs.mode || 'cherry-pick' }}

‎.github/workflows/ci.yml‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# yamllint disable rule:line-length
2+
---
3+
name: CI
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- main
9+
push:
10+
branches:
11+
- main
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ci-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
pre-commit:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Clone the repository
25+
uses: actions/checkout@v7
26+
- name: Set up Python
27+
uses: actions/setup-python@v7
28+
with:
29+
python-version: 3.x
30+
- name: Perform pre-commit checks
31+
uses: step-security/pre-commit-action@v3
32+
env:
33+
SKIP: no-commit-to-branch
34+
35+
local-test:
36+
needs: pre-commit
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Clone the repository
40+
uses: actions/checkout@v7
41+
- name: Test the problem matcher
42+
id: expect-failure
43+
uses: ./
44+
with:
45+
config_file: .markdownlintrc
46+
files: .
47+
rules: examples/rules/custom.js
48+
continue-on-error: true
49+
- name: Check the result of the problem matcher test
50+
if: ${{ steps.expect-failure.outcome != 'failure' }}
51+
run: |
52+
exit 1
53+
- name: Test ignore_files
54+
uses: ./
55+
with:
56+
config_file: .markdownlintrc
57+
files: .
58+
ignore_files: examples/ignore/*
59+
rules: examples/rules/custom.js
60+
- name: Test ignore_path
61+
uses: ./
62+
with:
63+
config_file: .markdownlintrc
64+
files: .
65+
ignore_path: examples/.markdownlintignore
66+
rules: examples/rules/custom.js

‎.github/workflows/docker.yml‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish docker image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: 'Tag to release'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
if: startsWith(github.event.inputs.release_tag, 'v')
19+
steps:
20+
- name: Harden the runner (Audit all outbound calls)
21+
uses: step-security/harden-runner@v2
22+
with:
23+
egress-policy: audit
24+
25+
- name: Checkout
26+
uses: actions/checkout@v7
27+
- name: Validate tag format
28+
run: |
29+
TAG=${{ github.event.inputs.release_tag }}
30+
if ! echo "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
31+
echo "❌ Invalid tag format: $TAG"
32+
exit 1
33+
fi
34+
echo "✅ Valid semver tag: $TAG"
35+
- name: Log in to GitHub Container Registry
36+
uses: step-security/docker-login-action@v4
37+
with:
38+
registry: ghcr.io
39+
username: ${{ github.actor }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Set up QEMU for ARM builds
43+
uses: step-security/setup-qemu-action@v4
44+
45+
- name: Set up Docker Buildx
46+
uses: step-security/setup-buildx-action@v4
47+
48+
- name: Build and push Docker image
49+
uses: step-security/docker-build-push-action@v7
50+
with:
51+
context: .
52+
push: true
53+
platforms: linux/amd64,linux/arm64
54+
tags: |
55+
ghcr.io/${{ github.repository }}:${{ github.event.inputs.release_tag }}

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.envrc
2+
node_modules/

‎.markdownlintrc‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"default": true,
3+
"MD003": {
4+
"style": "atx"
5+
},
6+
"MD013": false
7+
}

‎.npmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
min-release-age=3

‎.pre-commit-config.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/gitleaks/gitleaks
3+
rev: v8.30.1
4+
hooks:
5+
- id: gitleaks
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v6.0.0
8+
hooks:
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace

0 commit comments

Comments
 (0)