Repository navigation
146 lines (139 loc) · 4.83 KB
/
Copy pathgitflow.yml
File metadata and controls
146 lines (139 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Gitflow checks, for a repository with a main branch of releases and a develop branch of unreleased work.
# Called from the repository's own workflow, on pull requests into both branches:
#
# on:
# pull_request:
# branches: [main, develop]
# types: [opened, synchronize, reopened, labeled, unlabeled]
# jobs:
# gitflow:
# uses: BioJulia/Workflows/.github/workflows/gitflow.yml@v1
# permissions:
# contents: read
#
# On a pull request into the main branch: Source branch, Version, Changelog and Breaking changes.
# On a pull request into develop: Source branch and Changelog entry.
# The checks of the other branch are skipped, and a skipped check counts as passed, so both branches' rulesets may require every check, as "gitflow / Source branch" and so on.
name: "Reusable: Gitflow"
on:
workflow_call:
inputs:
main-branch:
description: The branch of releases.
type: string
default: main
develop-branch:
description: The branch of unreleased work.
type: string
default: develop
skip-label:
description: The label that exempts a pull request into develop from the changelog entry.
type: string
default: skip changelog
check-links:
description: Whether to check the changelog's comparison links.
type: boolean
default: true
project:
description: The package's directory, relative to the repository's root, for a package in a subdirectory.
type: string
default: ''
registry:
description: The registry of the package's releases.
type: string
default: General
permissions: {}
jobs:
source:
name: Source branch
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# The history of both branches, and of the pull request's head commit, which the merge commit contains even from a fork.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: BioJulia/Workflows@v1.0.1
with:
check: source
model: gitflow
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
develop-branch: ${{ inputs.develop-branch }}
version:
name: Version
if: github.base_ref == inputs.main-branch
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: BioJulia/Workflows@v1.0.1
with:
check: version
model: gitflow
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
develop-branch: ${{ inputs.develop-branch }}
registry: ${{ inputs.registry }}
changelog:
name: Changelog
if: github.base_ref == inputs.main-branch
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: BioJulia/Workflows@v1.0.1
with:
check: changelog
model: gitflow
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
develop-branch: ${{ inputs.develop-branch }}
check-links: ${{ inputs.check-links }}
breaking:
name: Breaking changes
if: github.base_ref == inputs.main-branch
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: julia-actions/setup-julia@da908477b5db94c10ffce8cfea9f2b3b9d5db687 # v3.0.3
with:
version: '1'
- uses: julia-actions/cache@9353db09a0f2bbbdec6f41791918c75d37391b36 # v3.5.0
# Compares the main branch's public API and compat bounds with the head's, runs the main branch's tests against the head, and writes what it finds to the job summary.
- uses: BioJulia/Workflows@v1.0.1
with:
check: breaking
model: gitflow
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
develop-branch: ${{ inputs.develop-branch }}
entry:
name: Changelog entry
if: github.base_ref == inputs.develop-branch
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: BioJulia/Workflows@v1.0.1
with:
check: entry
model: gitflow
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
develop-branch: ${{ inputs.develop-branch }}
skip-label: ${{ inputs.skip-label }}