Skip to content

Commit 206df47

Browse files
committed
build(workflows): use the Scalingo actions
1 parent 819fa04 commit 206df47

File tree

3 files changed

+51
-14
lines changed

3 files changed

+51
-14
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
.github/workflows/* @scalingo/team-ist
1+
# Dependabot reviewers assignment
22
go.sum @scalingo/team-ist
3+
.github/workflows/* @scalingo/team-ist

.github/workflows/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Dependabot auto-approve
2+
on: pull_request
3+
4+
permissions:
5+
# Mandatory for both the auto-merge enabling and approval steps
6+
pull-requests: write
7+
# Mandatory for the auto-merge enabling step
8+
contents: write
9+
10+
jobs:
11+
dependabot:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- name: Automatically merge Dependabot PRs
15+
uses: Scalingo/actions/dependabot-automerge@main
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,53 @@
1111
#
1212
name: release
1313
on:
14+
pull_request:
1415
push:
16+
branches: [main, master, prod]
1517
tags:
16-
- 'v*'
18+
- "v*"
1719
jobs:
20+
linter:
21+
name: Linter on a PR
22+
if: ${{ github.event_name == 'pull_request' }}
23+
runs-on: ubuntu-24.04
24+
steps:
25+
- uses: Scalingo/actions/go-linter@main
26+
27+
tests:
28+
name: Unit Tests
29+
runs-on: ubuntu-24.04
30+
steps:
31+
- uses: Scalingo/actions/go-tests@main
32+
1833
goreleaser:
19-
runs-on: ubuntu-latest
34+
runs-on: ubuntu-24.04
35+
needs: [linter, tests]
2036
steps:
21-
-
22-
name: Checkout
37+
- name: Checkout
38+
if: startsWith(github.ref, 'refs/tags/')
2339
uses: actions/checkout@v5
24-
-
25-
name: Unshallow
40+
- name: Unshallow
41+
if: startsWith(github.ref, 'refs/tags/')
2642
run: git fetch --prune --unshallow
27-
-
28-
name: Set up Go
43+
44+
- name: Set up Go
45+
if: startsWith(github.ref, 'refs/tags/')
2946
uses: actions/setup-go@v6
3047
with:
31-
go-version-file: 'go.mod'
32-
-
33-
name: Import GPG key
48+
go-version-file: "go.mod"
49+
50+
- name: Import GPG key
51+
if: startsWith(github.ref, 'refs/tags/')
3452
id: import_gpg
3553
uses: Scalingo/ghaction-import-gpg@v1
3654
env:
3755
# These secrets will need to be configured for the repository:
3856
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
3957
PASSPHRASE: ${{ secrets.PASSPHRASE }}
40-
-
41-
name: Run GoReleaser
58+
59+
- name: Run GoReleaser
60+
if: startsWith(github.ref, 'refs/tags/')
4261
uses: goreleaser/goreleaser-action@v6
4362
with:
4463
version: latest

0 commit comments

Comments
 (0)