Skip to content

Commit 51b82ce

Browse files
committed
ci: aligned CI to use shared workflows
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent b3a47c4 commit 51b82ce

File tree

11 files changed

+118
-593
lines changed

11 files changed

+118
-593
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You'll find below general guidelines, which mostly correspond to standard practi
44

55
>**TL;DR**
66
>
7-
> If you're already an experience go developer on github, then you should just feel at home with us
7+
> If you're already an experienced go developer on github, then you should just feel at home with us
88
> and you may well skip the rest of this document.
99
>
1010
> You'll essentially find the usual guideline for a go library project on github.

.github/workflows/TODO.md

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

.github/workflows/auto-merge.yml

Lines changed: 5 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,15 @@
11
name: Dependabot auto-merge
2-
on: pull_request
32

43
permissions:
54
contents: read
65

6+
on:
7+
pull_request:
8+
79
jobs:
810
dependabot:
911
permissions:
1012
contents: write
1113
pull-requests: write
12-
runs-on: ubuntu-latest
13-
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
14-
steps:
15-
-
16-
name: Dependabot metadata
17-
id: metadata
18-
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
19-
-
20-
name: Auto-approve all dependabot PRs
21-
env:
22-
PR_URL: ${{github.event.pull_request.html_url}}
23-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
24-
run: gh pr review --approve "$PR_URL"
25-
-
26-
name: Auto-merge dependabot PRs for development dependencies
27-
if: ${{ contains(steps.metadata.outputs.dependency-group, 'development-dependencies') }}
28-
env:
29-
PR_URL: ${{github.event.pull_request.html_url}}
30-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
31-
run: gh pr merge --auto --rebase "$PR_URL"
32-
-
33-
name: Auto-merge dependabot PRs for go-openapi patches
34-
if: >-
35-
${{
36-
contains(steps.metadata.outputs.dependency-group, 'go-openapi-dependencies') &&
37-
(
38-
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
39-
steps.metadata.outputs.update-type == 'version-update:semver-patch'
40-
)
41-
}}
42-
env:
43-
PR_URL: ${{github.event.pull_request.html_url}}
44-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
45-
run: gh pr merge --auto --rebase "$PR_URL"
46-
-
47-
name: Auto-merge dependabot PRs for golang.org updates
48-
if: ${{ contains(steps.metadata.outputs.dependency-group, 'golang-org-dependencies') }}
49-
env:
50-
PR_URL: ${{github.event.pull_request.html_url}}
51-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
52-
run: gh pr merge --auto --rebase "$PR_URL"
53-
54-
# Auto merge is current disabled: we need automatic PRs to swap identity (e.g. using a Github App),
55-
# so the pull_request event is properly captured and the PR can validate.
56-
#actions-bot:
57-
# permissions:
58-
# contents: write
59-
# pull-requests: write
60-
# runs-on: ubuntu-latest
61-
# if: ${{ github.event.pull_request.user.login == 'github-actions[bot]' }}
62-
# steps:
63-
# -
64-
# name: Auto-approve all github-actions bot PRs
65-
# env:
66-
# PR_URL: ${{github.event.pull_request.html_url}}
67-
# GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
68-
# run: gh pr review --approve "$PR_URL"
69-
# -
70-
# name: Auto-merge github-actions bot PRs
71-
# env:
72-
# PR_URL: ${{github.event.pull_request.html_url}}
73-
# GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
74-
# run: gh pr merge --auto --rebase "$PR_URL"
14+
uses: go-openapi/ci-workflows/.github/workflows/auto-merge.yml@d0b50195d14745b9a9a8a41cf3bb7ecd874af37a # v0.1.1
15+
secrets: inherit

.github/workflows/bump-release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Bump Release
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
bump-patch:
10+
description: Bump a patch version release
11+
type: boolean
12+
required: false
13+
default: true
14+
bump-minor:
15+
description: Bump a minor version release
16+
type: boolean
17+
required: false
18+
default: false
19+
bump-major:
20+
description: Bump a major version release
21+
type: boolean
22+
required: false
23+
default: false
24+
tag-message-title:
25+
description: Tag message title to prepend to the release notes
26+
required: false
27+
type: string
28+
tag-message-body:
29+
description: |
30+
Tag message body to prepend to the release notes.
31+
(use "|" to replace end of line).
32+
required: false
33+
type: string
34+
35+
jobs:
36+
bump-release:
37+
permissions:
38+
contents: write
39+
uses: go-openapi/ci-workflows/.github/workflows/bump-release.yml@d0b50195d14745b9a9a8a41cf3bb7ecd874af37a # v0.1.1
40+
with:
41+
bump-patch: ${{ inputs.bump-patch }}
42+
bump-minor: ${{ inputs.bump-minor }}
43+
bump-major: ${{ inputs.bump-major }}
44+
tag-message-title: ${{ inputs.tag-message-title }}
45+
tag-message-body: ${{ inputs.tag-message-body }}
46+
secrets: inherit

.github/workflows/codeql.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,22 @@
11
name: "CodeQL"
22

3-
permissions:
4-
contents: read
5-
63
on:
74
push:
85
branches: [ "master" ]
96
pull_request:
107
branches: [ "master" ]
11-
paths-ignore:
8+
paths-ignore: # remove this clause if CodeQL is a required check
129
- '**/*.md'
1310
schedule:
1411
- cron: '39 19 * * 5'
1512

13+
permissions:
14+
contents: read
15+
1616
jobs:
17-
analyze:
18-
name: Analyze.
19-
runs-on: ubuntu-latest
20-
timeout-minutes: 360
17+
codeql:
2118
permissions:
2219
contents: read
2320
security-events: write
24-
# actions: read # <- is needed only for private repositories
25-
strategy:
26-
fail-fast: false
27-
matrix:
28-
language: ['go','actions']
29-
steps:
30-
-
31-
name: Checkout repository
32-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
33-
-
34-
# Initializes the CodeQL tools for scanning.
35-
name: Initialize CodeQL
36-
uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
37-
with:
38-
languages: ${{ matrix.language }}
39-
-
40-
name: Analyze ${{ matrix.language }}
41-
uses: github/codeql-action/analyze@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
21+
uses: go-openapi/ci-workflows/.github/workflows/codeql.yml@d0b50195d14745b9a9a8a41cf3bb7ecd874af37a # v0.1.1
22+
secrets: inherit

.github/workflows/contributors.yml

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,18 @@
11
name: Contributors
22

3-
permissions:
4-
contents: read
5-
63
on:
74
schedule:
85
- cron: '18 4 * * 6'
96

107
workflow_dispatch:
118

9+
permissions:
10+
contents: read
11+
1212
jobs:
13-
update-contributors:
14-
name: all-time contributors
13+
contributors:
1514
permissions:
1615
pull-requests: write
1716
contents: write
18-
runs-on: ubuntu-latest
19-
steps:
20-
-
21-
name: Checkout repository
22-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
23-
-
24-
name: Identify all-time contributors to this repository
25-
uses: github/contributors@e345de71bbd056a34a70709afd4f4bf0a270cc1a # v1.7.7
26-
env:
27-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
REPOSITORY: ${{ github.repository }}
29-
LINK_TO_PROFILE: 'True'
30-
-
31-
name: Rename contributor file
32-
run: |
33-
rm -rf contributors.json
34-
mv contributors.md CONTRIBUTORS.md
35-
-
36-
name: Create a PR
37-
id: create-pull-request
38-
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
39-
with:
40-
commit-message: "doc: updated contributors file"
41-
branch: doc/contributors-bot
42-
delete-branch: true
43-
title: "doc: updated contributors file"
44-
token: ${{ secrets.GITHUB_TOKEN }}
45-
labels: "bot"
46-
draft: true
47-
assignees: fredbi
48-
reviewers: fredbi
49-
sign-commits: true
17+
uses: go-openapi/ci-workflows/.github/workflows/contributors.yml@d0b50195d14745b9a9a8a41cf3bb7ecd874af37a # v0.1.1
18+
secrets: inherit

0 commit comments

Comments
 (0)