Skip to content

Commit 0ea4094

Browse files
committed
DIA-3557: Update yammlint GitHub Action
1 parent 14049da commit 0ea4094

File tree

9 files changed

+137
-180
lines changed

9 files changed

+137
-180
lines changed

.github/release-drafter.yml

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,28 @@
1-
name-template: 'v$RESOLVED_VERSION'
2-
tag-template: 'v$RESOLVED_VERSION'
1+
name-template: "$RESOLVED_VERSION"
2+
tag-template: "v$RESOLVED_VERSION"
33
categories:
4-
- title: '🚀 Features'
4+
- title: "🚀 Features"
55
labels:
6-
- 'feature'
7-
- 'enhancement'
8-
- title: '🐛 Bug Fixes'
6+
- "feature"
7+
- "enhancement"
8+
- title: "🐛 Bug Fixes"
99
labels:
10-
- 'fix'
11-
- 'bugfix'
12-
- 'bug'
13-
- title: '🧹 Maintenance'
10+
- "bug"
11+
- title: "🧰 Maintenance"
1412
labels:
15-
- 'chore'
16-
- 'dependencies'
17-
version-resolver:
18-
major:
13+
- "maintenance"
14+
- title: "📦 Dependencies"
1915
labels:
20-
- 'feature'
21-
minor:
16+
- "docker dependency"
17+
- "github dependency"
18+
- "go dependency"
19+
- title: "✏️ Documentation"
2220
labels:
23-
- 'enhancement'
24-
patch:
25-
labels:
26-
- 'fix'
27-
- 'bugfix'
28-
- 'bug'
29-
- 'chore'
30-
- 'dependencies'
31-
default: patch
21+
- "documentation"
22+
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
23+
exclude-labels:
24+
- "skip-changelog"
3225
template: |
3326
## Changes
3427
3528
$CHANGES
36-
37-
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

.github/workflows/autodev.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Autodev
3+
4+
on:
5+
push:
6+
branches-ignore: [dev]
7+
pull_request:
8+
types: [labeled, unlabeled, closed]
9+
10+
jobs:
11+
autodev:
12+
uses: Staffbase/gha-workflows/.github/workflows/[email protected]
13+
with:
14+
labels: true
15+
secrets:
16+
app_id: ${{ vars.STAFFBASE_ACTIONS_APP_ID }}
17+
private_key: ${{ secrets.STAFFBASE_ACTIONS_PRIVATE_KEY }}

.github/workflows/build.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
name: Build & Deploy
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
pull_request:
10+
types: [opened, synchronize, reopened]
11+
release:
12+
types: [published]
13+
14+
jobs:
15+
test:
16+
name: Test
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version-file: "go.mod"
28+
29+
- name: Test
30+
run: go test ./...
31+
32+
- name: Build
33+
run: go build -o ./yamllint-action .
34+
35+
push:
36+
name: Push
37+
needs: test
38+
runs-on: ubuntu-24.04
39+
steps:
40+
- name: Check out code
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
45+
- name: Docker Metadata
46+
id: metadata
47+
uses: docker/metadata-action@v5
48+
with:
49+
images: |
50+
staffbase/yamllint-action
51+
tags: |
52+
type=ref,event=branch
53+
type=semver,pattern={{raw}}
54+
55+
- name: Set up QEMU
56+
uses: docker/setup-qemu-action@v3
57+
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@v3
60+
61+
- name: Login to DockerHub
62+
uses: docker/login-action@v3
63+
with:
64+
username: ${{ vars.DOCKERHUB_USERNAME }}
65+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
66+
67+
- name: Build and Push Docker Image
68+
id: docker_build
69+
uses: docker/build-push-action@v6
70+
with:
71+
push:
72+
${{ github.event_name == 'release' && github.event.action ==
73+
'published' }}
74+
context: .
75+
file: ./Dockerfile
76+
platforms: linux/amd64
77+
cache-from: type=gha
78+
cache-to: type=gha,mode=max
79+
tags: ${{ steps.metadata.outputs.tags }}
80+
labels: ${{ steps.metadata.outputs.labels }}

.github/workflows/ci.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/release-drafter.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Release Drafter
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
uses: Staffbase/gha-workflows/.github/workflows/[email protected]
12+
secrets:
13+
app_id: ${{ vars.STAFFBASE_ACTIONS_APP_ID }}
14+
private_key: ${{ secrets.STAFFBASE_ACTIONS_PRIVATE_KEY }}

.github/workflows/release.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.goreleaser.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
# See the License for the specific language governing permissions and
1010
# limitations under the License.
1111

12-
FROM python:3.13.1-alpine3.19
13-
14-
WORKDIR /go/src/github.com/Staffbase/yamllint-action
12+
FROM golang:1.24.1 AS build
13+
WORKDIR /yamllint-action
14+
COPY go.mod go.sum /yamllint-action/
15+
RUN go mod download
16+
COPY . .
17+
RUN export CGO_ENABLED=0 && go build -o ./yamllint-action .
1518

19+
FROM python:3.13.1-alpine3.19
1620
RUN pip install --no-cache-dir yamllint==1.35.1 && \
1721
adduser --disabled-password --gecos "" --home "/nonexistent" --shell "/sbin/nologin" --no-create-home --uid 10001 appuser
18-
19-
COPY yamllint-action /yamllint-action
22+
COPY --from=build /yamllint-action/yamllint-action /script_exporter
2023
COPY entrypoint.sh /entrypoint.sh
21-
2224
USER appuser:appuser
23-
2425
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)