Skip to content

Commit bf72ff6

Browse files
committed
fix: resolve merge conflict in safePath combining segment validation with symlink resolution
2 parents 9f19c11 + e23c787 commit bf72ff6

24 files changed

Lines changed: 560 additions & 92 deletions

.changie.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
changesDir: changes
2+
unreleasedDir: unreleased
3+
headerPath: header.tpl.md
4+
changelogPath: CHANGELOG.md
5+
versionExt: md
6+
versionFormat: '## [{{ .Version }}](https://github.com/skyoo2003/devcloud/releases/tag/{{ .Version }}) - {{ .Time.Format "2006-01-02" }}'
7+
8+
9+
kindFormat: "### {{ .Kind }}"
10+
changeFormat: "* {{ .Body }} ([#{{ .Custom.Issue }}](https://github.com/skyoo2003/devcloud/issues/{{ .Custom.Issue }}))"
11+
kinds:
12+
- label: Added
13+
- label: Changed
14+
- label: Deprecated
15+
- label: Removed
16+
- label: Fixed
17+
- label: Security
18+
- label: Documentation
19+
custom:
20+
- key: Issue
21+
label: Issue Number
22+
type: int
23+
minInt: 1

.github/workflows/cd.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ jobs:
2525
github.event.workflow_run.conclusion == 'success' &&
2626
github.event.workflow_run.event == 'push'
2727
steps:
28-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2929
with:
3030
ref: ${{ github.event.workflow_run.head_sha }}
3131

3232
- name: Docker metadata
3333
id: meta
34-
uses: docker/metadata-action@v6
34+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6
3535
with:
3636
images: ghcr.io/${{ github.repository }}
3737
tags: |
3838
type=raw,value=latest,enable=${{ github.event.workflow_run.head_branch == 'main' }},suffix=-${{ matrix.arch }}
3939
type=raw,value=${{ github.event.workflow_run.head_branch }},enable=${{ startsWith(github.event.workflow_run.head_branch, 'v') }},suffix=-${{ matrix.arch }}
4040
4141
- name: Set up Docker Buildx
42-
uses: docker/setup-buildx-action@v4
42+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
4343

4444
- name: Login to GHCR
45-
uses: docker/login-action@v4
45+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
4646
with:
4747
registry: ghcr.io
4848
username: ${{ github.actor }}
4949
password: ${{ secrets.GITHUB_TOKEN }}
5050

5151
- name: Build and push
52-
uses: docker/build-push-action@v7
52+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
5353
with:
5454
context: .
5555
file: docker/Dockerfile
@@ -69,18 +69,18 @@ jobs:
6969
steps:
7070
- name: Docker metadata
7171
id: meta
72-
uses: docker/metadata-action@v6
72+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6
7373
with:
7474
images: ghcr.io/${{ github.repository }}
7575
tags: |
7676
type=raw,value=latest,enable=${{ github.event.workflow_run.head_branch == 'main' }}
7777
type=raw,value=${{ github.event.workflow_run.head_branch }},enable=${{ startsWith(github.event.workflow_run.head_branch, 'v') }}
7878
7979
- name: Set up Docker Buildx
80-
uses: docker/setup-buildx-action@v4
80+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
8181

8282
- name: Login to GHCR
83-
uses: docker/login-action@v4
83+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
8484
with:
8585
registry: ghcr.io
8686
username: ${{ github.actor }}

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ jobs:
1414
name: golangci-lint
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v6
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1818

1919
- name: Set up Go
20-
uses: actions/setup-go@v6
20+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
2121
with:
2222
go-version: "1.26"
2323

2424
- name: Install SQLite dev headers
2525
run: sudo apt-get install -y libsqlite3-dev
2626

2727
- name: Run golangci-lint
28-
uses: golangci/golangci-lint-action@v8
28+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
2929
with:
3030
version: latest
3131
args: --timeout=5m

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
pull-requests: write
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: release-drafter/release-drafter@v6
19+
- uses: release-drafter/release-drafter@67e173cadb2fbd3de94f4a861e0c48c913b462ae # v6
2020
with:
2121
config-name: release-drafter.yml
2222
env:

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
packages: write
14+
attestations: write
15+
steps:
16+
- name: Checkout the code
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
18+
with:
19+
fetch-depth: 0
20+
- name: Set up Go
21+
uses: actions/setup-go@41dfa10bef8ca8f7c4c7cec63b269ccb8a9156b9 # v6
22+
with:
23+
go-version-file: go.mod
24+
cache-dependency-path: go.sum
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
27+
- name: Login to GitHub Container Registry
28+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Verify changie release notes exist
34+
run: |
35+
if [ ! -f "changes/${{ github.ref_name }}.md" ]; then
36+
echo "::error::Changie fragment changes/${{ github.ref_name }}.md not found."
37+
echo "::error::Run 'changie batch ${{ github.ref_name }}' and 'changie merge' before pushing the tag."
38+
exit 1
39+
fi
40+
- name: Execute GoReleaser
41+
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # goreleaser-action v7
42+
with:
43+
distribution: goreleaser
44+
version: "~> v2"
45+
args: release --clean --release-notes changes/${{ github.ref_name }}.md
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
- name: Upload assets
49+
uses: actions/upload-artifact@5d5df5e032fcb57d3c9d9901e9b8f8b2b7d8051a # v7
50+
with:
51+
name: devcloud
52+
path: dist/*

.github/workflows/smithy-sync.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
sync:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v6
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1717

1818
- name: Set up Go
19-
uses: actions/setup-go@v6
19+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
2020
with:
2121
go-version: "1.26"
2222

@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Create Pull Request
5454
if: steps.changes.outputs.changed == 'true'
55-
uses: peter-evans/create-pull-request@v8
55+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
5656
with:
5757
commit-message: "chore: sync Smithy models and regenerate code"
5858
title: "chore: weekly Smithy model sync"

.goreleaser.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
version: 2
2+
3+
project_name: devcloud
4+
5+
env:
6+
- GO111MODULE=on
7+
- CGO_ENABLED=0
8+
9+
before:
10+
hooks:
11+
- go mod download
12+
13+
builds:
14+
- id: devcloud
15+
binary: devcloud
16+
main: cmd/devcloud/main.go
17+
goos:
18+
- darwin
19+
- linux
20+
- windows
21+
goarch:
22+
- amd64
23+
- arm64
24+
25+
archives:
26+
- id: devcloud
27+
format: tar.gz
28+
format_overrides:
29+
- goos: windows
30+
format: zip
31+
files:
32+
- LICENSE
33+
- README.md
34+
- CHANGELOG.md
35+
36+
changelog:
37+
disable: false
38+
39+
checksum:
40+
algorithm: sha256
41+
name_template: 'CHECKSUMS'
42+
43+
dockers_v2:
44+
- images:
45+
- ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/{{ .ProjectName }}
46+
dockerfile: Dockerfile.goreleaser
47+
ids:
48+
- devcloud
49+
sbom: false
50+
flags:
51+
- "--provenance=false"
52+
tags:
53+
- "{{ .Tag }}-alpine"
54+
- "v{{ .Major }}.{{ .Minor }}-alpine"
55+
- "v{{ .Major }}-alpine"
56+
- "latest-alpine"
57+
labels:
58+
org.opencontainers.image.created: "{{ .Date }}"
59+
org.opencontainers.image.source: "https://github.com/{{ .Env.GITHUB_REPOSITORY_OWNER }}/{{ .ProjectName }}"
60+
org.opencontainers.image.title: "{{ .ProjectName }}"
61+
org.opencontainers.image.revision: "{{ .FullCommit }}"
62+
org.opencontainers.image.version: "{{ .Version }}"
63+
64+
release:
65+
name_template: "{{ .Version }}"
66+
disable: false
67+
mode: replace

Dockerfile.goreleaser

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM --platform=$BUILDPLATFORM alpine:3.21
2+
3+
RUN adduser --system --home /devcloud appuser
4+
VOLUME /devcloud
5+
WORKDIR /devcloud
6+
ARG TARGETOS
7+
ARG TARGETARCH
8+
COPY ${TARGETOS}/${TARGETARCH}/devcloud /usr/bin/devcloud
9+
10+
USER appuser
11+
ENTRYPOINT ["devcloud"]

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build test codegen run clean test-compat build-web build-all docker-build docker-run
1+
.PHONY: build test codegen run clean test-compat build-web build-all docker-build docker-run changelog
22

33
build:
44
go build -o dist/devcloud ./cmd/devcloud
@@ -32,3 +32,10 @@ docker-run:
3232

3333
clean:
3434
rm -rf dist/ data/
35+
36+
changelog:
37+
@if [ -z "$(VERSION)" ]; then \
38+
echo "VERSION is required. Usage: make changelog VERSION=v0.2.0"; \
39+
exit 1; \
40+
fi
41+
@changie batch $(VERSION) && changie merge

changes/header.tpl.md

Whitespace-only changes.

0 commit comments

Comments
 (0)