Skip to content

Commit f868b3b

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

File tree

9 files changed

+140
-180
lines changed

9 files changed

+140
-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: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
- name: SonarCloud Scan
36+
uses: SonarSource/[email protected]
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
40+
41+
push:
42+
needs: test
43+
runs-on: ubuntu-24.04
44+
steps:
45+
- name: Check out code
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Docker Metadata
51+
id: metadata
52+
uses: docker/metadata-action@v5
53+
with:
54+
images: |
55+
staffbase/yamllint-action
56+
tags: |
57+
type=ref,event=branch
58+
type=semver,pattern={{raw}}
59+
60+
- name: Set up QEMU
61+
uses: docker/setup-qemu-action@v3
62+
63+
- name: Set up Docker Buildx
64+
uses: docker/setup-buildx-action@v3
65+
66+
- name: Login to DockerHub
67+
uses: docker/login-action@v3
68+
with:
69+
username: ${{ vars.DOCKERHUB_USERNAME }}
70+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
71+
72+
- name: Build and Push Docker Image
73+
id: docker_build
74+
uses: docker/build-push-action@v6
75+
with:
76+
push: true
77+
context: .
78+
file: ./Dockerfile
79+
platforms: linux/amd64
80+
cache-from: type=gha
81+
cache-to: type=gha,mode=max
82+
tags: ${{ steps.metadata.outputs.tags }}
83+
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)