Skip to content

Commit 7f2eab7

Browse files
feat(workflows): use-workflow_call-events
1 parent ceabe9f commit 7f2eab7

31 files changed

Lines changed: 430 additions & 328 deletions

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ filename =
33
*.py
44
max-line-length = 120
55
extend-exclude =
6+
.venv/
67
venv/

.github/label-actions.yml

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

.github/semantic.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ titleAndCommits: false
1212
anyCommit: false
1313
allowMergeCommits: false
1414
allowRevertCommits: false
15+
targetUrl: https://docs.lizardbyte.dev/latest/developers/contributing.html#creating-a-pull-request

.github/workflows/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# LizardByte org workflows
2+
3+
Files prefixed with `__` are only used in the `.github` repository and not replicated to other repositories;
4+
however some of they may be called from other workflows.
5+
6+
Workflows that can be called from other repositories are prefixed with `__call-` and are not replicated
7+
to other repositories. They also have an accompanying workflow named `_<name>.yml` that is replicated to the
8+
respective repositories.
9+
10+
Workflows that prefixed with a single `_` are replicated to other repositories and this indicates
11+
that the workflow should not be modified when inside the other repositories.
Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
---
2-
# This workflow is centrally managed in https://github.com/<organization>/.github/
3-
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4-
# the above-mentioned repo.
5-
62
# This workflow will analyze all supported languages in the repository using CodeQL Analysis.
73

8-
name: "CodeQL"
4+
name: CodeQL (called)
95
permissions:
106
contents: read
117

128
on:
13-
push:
14-
branches:
15-
- master
169
pull_request:
1710
branches:
1811
- master
19-
schedule:
20-
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC
21-
22-
concurrency:
23-
group: "${{ github.workflow }}-${{ github.ref }}"
24-
cancel-in-progress: true
12+
types:
13+
- opened
14+
- synchronize
15+
- reopened
16+
workflow_call:
2517

2618
jobs:
2719
languages:
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
2-
# This workflow is centrally managed in https://github.com/<organization>/.github/
3-
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4-
# the above-mentioned repo.
2+
# This workflow will lint the code in the repository using various tools. Most linting tools in LizardByte
3+
# should be included in this workflow; however there are cases where that is not true, such as with eslint.
54

6-
# Common linting.
7-
8-
name: common lint
5+
name: common lint (called)
96
permissions:
107
contents: read
118

@@ -17,10 +14,7 @@ on:
1714
- opened
1815
- synchronize
1916
- reopened
20-
21-
concurrency:
22-
group: "${{ github.workflow }}-${{ github.ref }}"
23-
cancel-in-progress: true
17+
workflow_call:
2418

2519
jobs:
2620
lint:
Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
---
2-
# This workflow is centrally managed in https://github.com/<organization>/.github/
3-
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4-
# the above-mentioned repo.
5-
62
# This workflow is intended to work with all our organization Docker projects. A readme named `DOCKER_README.md`
73
# will be used to update the description on Docker hub.
84

@@ -18,26 +14,28 @@
1814
# `true` to build in two steps, stopping at `artifacts` build stage and extracting the image from there to the
1915
# GitHub runner.
2016

21-
name: CI Docker
17+
name: Docker (called)
2218
permissions:
2319
contents: read
2420

2521
on:
26-
pull_request:
27-
branches:
28-
- master
29-
types:
30-
- opened
31-
- synchronize
32-
- reopened
33-
push:
34-
branches:
35-
- master
36-
workflow_dispatch:
37-
38-
concurrency:
39-
group: "${{ github.workflow }}-${{ github.ref }}"
40-
cancel-in-progress: true
22+
workflow_call:
23+
secrets:
24+
DOCKER_HUB_USERNAME:
25+
description: 'Docker Hub username to use for the workflow.'
26+
required: false
27+
DOCKER_HUB_ACCESS_TOKEN:
28+
description: 'Docker Hub access token to use for the workflow.'
29+
required: false
30+
GH_BOT_NAME:
31+
description: 'GitHub bot name to use for the workflow.'
32+
required: false
33+
GH_BOT_TOKEN:
34+
description: 'GitHub bot token to use for the workflow.'
35+
required: false
36+
GH_TOKEN:
37+
description: 'GitHub token to use for the workflow.'
38+
required: false
4139

4240
jobs:
4341
check_dockerfiles:
@@ -126,7 +124,7 @@ jobs:
126124
uses: LizardByte/setup-release-action@v2025.426.225
127125
with:
128126
dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }}
129-
github_token: ${{ secrets.GITHUB_TOKEN }}
127+
github_token: ${{ secrets.GH_TOKEN }}
130128

131129
docker:
132130
name: Docker${{ matrix.tag }}

.github/workflows/release-notifier.yml renamed to .github/workflows/__call-release-notifier.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
---
2-
# This workflow is centrally managed in https://github.com/<organization>/.github/
3-
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4-
# the above-mentioned repo.
5-
6-
# Create a blog post for a new release and open a PR to the blog repo
7-
8-
name: Release Notifications
2+
name: Release Notifications (called)
93
permissions:
104
contents: read
115

126
on:
13-
release:
14-
types:
15-
- released # this triggers when a release is published, but does not include pre-releases or drafts
7+
workflow_call:
8+
secrets:
9+
GH_TOKEN:
10+
description: 'GitHub token to use for the workflow.'
11+
required: true
1612

1713
jobs:
1814
update-blog:
@@ -111,7 +107,7 @@ jobs:
111107
steps.check-release.outputs.isLatestRelease == 'true'
112108
uses: peter-evans/create-pull-request@v7
113109
with:
114-
token: ${{ secrets.GH_BOT_TOKEN }}
110+
token: ${{ secrets.GH_TOKEN }}
115111
commit-message: |
116112
chore: Add blog post for ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}
117113
branch: bot/add-${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
@@ -124,7 +120,7 @@ jobs:
124120

125121
- name: Automerge PR
126122
env:
127-
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
123+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
128124
if: >-
129125
steps.check-label.outputs.hasTopic == 'true' &&
130126
steps.check-release.outputs.isLatestRelease == 'true'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# Update changelog on release events.
3+
4+
name: Update changelog (called)
5+
permissions:
6+
contents: read
7+
8+
on:
9+
workflow_call:
10+
secrets:
11+
GH_TOKEN:
12+
description: 'GitHub token to use for the workflow.'
13+
required: true
14+
15+
jobs:
16+
update-changelog:
17+
name: Update Changelog
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Update Changelog
21+
uses: LizardByte/update-changelog-action@v2025.426.173858
22+
with:
23+
changelogBranch: changelog
24+
changelogFile: CHANGELOG.md
25+
token: ${{ secrets.GH_TOKEN }}
Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
---
2-
# This workflow is centrally managed in https://github.com/<organization>/.github/
3-
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4-
# the above-mentioned repo.
5-
6-
# To use, add the `rtd` repository label to identify repositories that should trigger this workflow.
7-
# If the project slug is not the repository name, add a repository variable named `READTHEDOCS_SLUG` with the value of
8-
# the ReadTheDocs project slug.
9-
10-
# Update readthedocs on release events.
11-
12-
name: Update docs
2+
name: Update docs (called)
133
permissions: {}
144

155
on:
16-
release:
17-
types:
18-
- created
19-
- edited
20-
- deleted
21-
22-
concurrency:
23-
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
24-
cancel-in-progress: true
6+
workflow_call:
7+
inputs:
8+
readthedocs_slug:
9+
description: 'Read the Docs project slug (defaults to repository name in lowercase)'
10+
required: false
11+
type: string
12+
default: ''
13+
secrets:
14+
READTHEDOCS_TOKEN:
15+
description: 'Read the Docs API token with write access to the project'
16+
required: true
2517

2618
jobs:
2719
update-docs:
2820
env:
29-
RTD_SLUG: ${{ vars.READTHEDOCS_SLUG }}
21+
RTD_SLUG: ${{ inputs.READTHEDOCS_SLUG }}
3022
RTD_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
3123
TAG: ${{ github.event.release.tag_name }}
3224
if: >-

0 commit comments

Comments
 (0)