Repository navigation
77 lines (75 loc) · 3.34 KB
/
Copy pathci.yml
File metadata and controls
77 lines (75 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Verify
on:
pull_request:
branches: [dev, main]
permissions:
contents: read
concurrency:
group: verify-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
name: verify
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Require promotion to fast-forward main from dev
if: github.base_ref == 'main'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PROMOTION_SOURCE: ${{ github.event.pull_request.head.repo.full_name }}:${{ github.head_ref }}
PULL_REQUEST: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
if [[ "$PROMOTION_SOURCE" != "$GITHUB_REPOSITORY:dev" ]]; then
echo "::error::main receives only promotions from $GITHUB_REPOSITORY:dev. Target dev instead."
exit 1
fi
if ! git merge-base --is-ancestor "$BASE_SHA" "$HEAD_SHA"; then
echo "::error::main is not an ancestor of dev. Promotion must be a fast-forward."
exit 1
fi
{
echo "## Promotion"
echo
echo "Fast-forwards main from \`$BASE_SHA\` to the exact dev commit \`$HEAD_SHA\` ($(git rev-list --count "$BASE_SHA..$HEAD_SHA") commits)."
echo "Once verify passes, run the promote workflow for pull request #$PULL_REQUEST. Promotion publishes nothing; a version tag on main does."
} >> "$GITHUB_STEP_SUMMARY"
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
package-manager-cache: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.0
- name: Validate public contribution text
env:
PUBLIC_TITLE: ${{ github.event.pull_request.title }}
PUBLIC_BODY: ${{ github.event.pull_request.body }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: bun scripts/check-publication.ts --metadata-env --range "$BASE_SHA..HEAD"
- name: Install verified Gitleaks
env:
GITLEAKS_ARCHIVE: gitleaks_8.30.1_linux_x64.tar.gz
GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
GITLEAKS_VERSION: 8.30.1
run: |
set -euo pipefail
curl --fail --silent --show-error --location \
--output "$RUNNER_TEMP/$GITLEAKS_ARCHIVE" \
"https://github.com/gitleaks/gitleaks/releases/download/v$GITLEAKS_VERSION/$GITLEAKS_ARCHIVE"
printf '%s %s\n' "$GITLEAKS_SHA256" "$RUNNER_TEMP/$GITLEAKS_ARCHIVE" | sha256sum --check --strict
tar --extract --gzip --file "$RUNNER_TEMP/$GITLEAKS_ARCHIVE" --directory "$RUNNER_TEMP" gitleaks
printf '%s\n' "$RUNNER_TEMP" >> "$GITHUB_PATH"
- name: Prepare pinned Rust toolchain
run: rustup toolchain install 1.90 --profile minimal --component rustfmt --target wasm32-wasip2
- run: bun install --frozen-lockfile
- run: bun run verify
- name: Package VS Code
run: |
mkdir -p artifacts
bun run --cwd vscode package -- --out ../artifacts/rootform.vsix