Skip to content

Commit f0be41b

Browse files
authored
chore(ci): rename input and output options for workflows to improve consistency with Github (#666)
1 parent 761b9ed commit f0be41b

6 files changed

Lines changed: 61 additions & 54 deletions

File tree

.github/workflows/_build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ name: Build the package
2323
on:
2424
workflow_call:
2525
inputs:
26-
disable_pip_audit:
27-
required: true
26+
disable-pip-audit:
2827
type: boolean
28+
required: true
2929
description: Enable or disable running pip_audit to check installed packages for vulnerabilities
3030
outputs:
3131
artifacts-sha256:
32-
description: The hash of the artifacts
3332
value: ${{ jobs.build.outputs.artifacts-sha256 }}
33+
description: The hash of the artifacts
3434
permissions:
3535
contents: read
3636
env:
@@ -81,7 +81,7 @@ jobs:
8181
# Audit all currently installed packages for security vulnerabilities. This step can
8282
# be disabled by setting the repository variable DISABLE_PIP_AUDIT to 'true'.
8383
- name: Audit installed packages
84-
if: ${{ !inputs.disable_pip_audit }}
84+
if: ${{ !inputs.disable-pip-audit }}
8585
run: make audit
8686

8787
# Build the sdist and wheel distribution of the package and docs as a zip file.

.github/workflows/_generate-rebase.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ name: Rebase branch
55
on:
66
workflow_call:
77
inputs:
8-
to_head:
8+
to-head:
99
type: string
1010
required: true
1111
description: Branch that is being rebased
12-
from_base:
12+
from-base:
1313
type: string
1414
required: true
1515
description: Base branch
16-
git_user_name:
17-
required: true
16+
git-user-name:
1817
type: string
19-
description: Name of the git user that rebases and pushes the to_head branch
20-
git_user_email:
2118
required: true
19+
description: Name of the git user who rebases and pushes the to_head branch
20+
git-user-email:
2221
type: string
22+
required: true
2323
description: Email address of said git user
2424
secrets:
2525
REPO_ACCESS_TOKEN:
@@ -53,7 +53,7 @@ jobs:
5353
git rebase "$FROM_BASE"
5454
git push --force-with-lease
5555
env:
56-
USER_NAME: ${{ inputs.git_user_name }}
57-
USER_EMAIL: ${{ inputs.git_user_email }}
58-
TO_HEAD: ${{ inputs.to_head }}
59-
FROM_BASE: ${{ inputs.from_base }}
56+
USER_NAME: ${{ inputs.git-user-name }}
57+
USER_EMAIL: ${{ inputs.git-user-email }}
58+
TO_HEAD: ${{ inputs.to-head }}
59+
FROM_BASE: ${{ inputs.from-base }}

.github/workflows/_release-notifications.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ name: Release Notifications
55
on:
66
workflow_call:
77
inputs:
8-
repo_name:
9-
required: true
8+
repo-name:
109
type: string
11-
release_tag:
1210
required: true
11+
description: Repository name used for the notification
12+
release-tag:
1313
type: string
14-
release_url:
1514
required: true
15+
description: Tag name of the release for the notification
16+
release-url:
1617
type: string
18+
required: true
19+
description: URL to the release page for the notification
1720
secrets:
1821
SLACK_WEBHOOK_URL:
1922
required: true
@@ -34,13 +37,13 @@ jobs:
3437
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3538
SLACK_WEBHOOK_MSG: |
3639
{
37-
"text": "${{ inputs.repo_name }} published a new release ${{ inputs.release_tag }}",
40+
"text": "${{ inputs.repo-name }} published a new release ${{ inputs.release-tag }}",
3841
"blocks": [
3942
{
4043
"type": "section",
4144
"text": {
4245
"type": "mrkdwn",
43-
"text": "*${{ inputs.repo_name }}* published a new release <${{ inputs.release_url }}|${{ inputs.release_tag }}>"
46+
"text": "*${{ inputs.repo-name }}* published a new release <${{ inputs.release-url }}|${{ inputs.release-tag }}>"
4447
}
4548
}
4649
]

.github/workflows/_wiki-documentation.yaml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,26 @@ name: Publish Github Wiki documentation
66
on:
77
workflow_call:
88
inputs:
9-
release_tag:
10-
required: true
9+
release-tag:
1110
type: string
12-
release_url:
1311
required: true
12+
description: Tag name of the release used in the Wiki commit message
13+
release-url:
1414
type: string
15-
artifact_name:
1615
required: true
16+
description: URL to the release page used in the Wiki commit message
17+
artifact-name:
1718
type: string
18-
git_user_name:
1919
required: true
20+
description: Name of the build artifact from which to extract the Wiki pages
21+
git-user-name:
2022
type: string
21-
git_user_email:
2223
required: true
24+
description: Name of the git user who commits and pushes the Wiki change set
25+
git-user-email:
2326
type: string
27+
required: true
28+
description: Email address of said git user
2429
secrets:
2530
REPO_ACCESS_TOKEN:
2631
required: true
@@ -54,7 +59,7 @@ jobs:
5459
- name: Download artifact
5560
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
5661
with:
57-
name: ${{ inputs.artifact_name }}
62+
name: ${{ inputs.artifact-name }}
5863
path: dist
5964

6065
# Unpack the Markdown docs into the Wiki repository. Delete existing files first
@@ -78,9 +83,10 @@ jobs:
7883
git push
7984
fi
8085
env:
81-
USER_NAME: ${{ inputs.git_user_name }}
82-
USER_EMAIL: ${{ inputs.git_user_email }}
86+
USER_NAME: ${{ inputs.git-user-name }}
87+
USER_EMAIL: ${{ inputs.git-user-email }}
8388
WIKI_COMMIT_MESSAGE: |
84-
docs: update for ${{ inputs.release_tag }}
89+
docs: update for ${{ inputs.release-tag }}
8590
86-
Link: ${{ inputs.release_url }}
91+
Refs: ${{ github.sha }}
92+
Link: ${{ inputs.release-url }}

.github/workflows/pr-change-set.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
permissions:
2020
contents: read
2121
with:
22-
disable_pip_audit: ${{ vars.DISABLE_PIP_AUDIT == 'true' }}
22+
disable-pip-audit: ${{ vars.DISABLE_PIP_AUDIT == 'true' }}

.github/workflows/release.yaml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ on:
99
- staging
1010
permissions:
1111
contents: read
12-
env:
13-
# Duplicate these values for the `wiki` job below!
14-
ARTIFACT_NAME: artifact-ubuntu-latest-python-3.11
15-
# This is the username and email for the user who commits and pushes the release
16-
# commit. In an organisation that should be a dedicated devops account.
17-
USER_NAME: jenstroeger
18-
USER_EMAIL: jenstroeger@users.noreply.github.com
1912

2013
jobs:
2114
check:
@@ -24,7 +17,7 @@ jobs:
2417
permissions:
2518
contents: read
2619
with:
27-
disable_pip_audit: ${{ vars.DISABLE_PIP_AUDIT == 'true' }}
20+
disable-pip-audit: ${{ vars.DISABLE_PIP_AUDIT == 'true' }}
2821

2922
# On pushes to the 'main' branch create a new release by bumping the version
3023
# and generating a change log. That's the new bump commit and associated tag.
@@ -63,6 +56,11 @@ jobs:
6356
git config --global user.name "$USER_NAME"
6457
git config --global user.email "$USER_EMAIL"
6558
git config --list --global # For debug purposes.
59+
env:
60+
# This is the username and email for the user who commits and pushes the release
61+
# commit. In an organisation that should be a dedicated devops account.
62+
USER_NAME: jenstroeger
63+
USER_EMAIL: jenstroeger@users.noreply.github.com
6664

6765
# In some cases a user may merge commits that don't cause a version bump, which causes commitizen
6866
# to fail with error code 21 (NoneIncrementExit). Thus we silence that particular error to avoid
@@ -82,7 +80,7 @@ jobs:
8280
permissions:
8381
contents: read
8482
with:
85-
disable_pip_audit: ${{ vars.DISABLE_PIP_AUDIT == 'true' }}
83+
disable-pip-audit: ${{ vars.DISABLE_PIP_AUDIT == 'true' }}
8684

8785
# Create a new Release on Github from the verified build artifacts, and optionally
8886
# publish the artifacts to a PyPI server.
@@ -111,7 +109,7 @@ jobs:
111109
- name: Download artifact
112110
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
113111
with:
114-
name: ${{ env.ARTIFACT_NAME }}
112+
name: artifact-ubuntu-latest-python-3.11
115113
path: dist
116114

117115
# Verify hashes by first computing hashes for the artifacts and then comparing them
@@ -229,9 +227,9 @@ jobs:
229227
permissions:
230228
contents: read
231229
with:
232-
repo_name: ${{ github.event.repository.name }}
233-
release_tag: ${{ needs.release.outputs.release-tag }}
234-
release_url: ${{ needs.release.outputs.release-url }}
230+
repo-name: ${{ github.event.repository.name }}
231+
release-tag: ${{ needs.release.outputs.release-tag }}
232+
release-url: ${{ needs.release.outputs.release-url }}
235233
secrets:
236234
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
237235

@@ -245,14 +243,14 @@ jobs:
245243
permissions:
246244
contents: read
247245
with:
248-
release_tag: ${{ needs.release.outputs.release-tag }}
249-
release_url: ${{ needs.release.outputs.release-url }}
246+
release-tag: ${{ needs.release.outputs.release-tag }}
247+
release-url: ${{ needs.release.outputs.release-url }}
250248
# Github disallows passing environment variables as arguments to a reusable
251249
# workflow, so we have to duplicate these values here. Related discussion
252250
# here: https://github.com/actions/toolkit/issues/931
253-
artifact_name: artifact-ubuntu-latest-python-3.11
254-
git_user_name: jenstroeger
255-
git_user_email: jenstroeger@users.noreply.github.com
251+
artifact-name: artifact-ubuntu-latest-python-3.11
252+
git-user-name: jenstroeger
253+
git-user-email: jenstroeger@users.noreply.github.com
256254
secrets:
257255
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
258256

@@ -267,9 +265,9 @@ jobs:
267265
permissions:
268266
contents: read
269267
with:
270-
to_head: staging
271-
from_base: origin/main
272-
git_user_name: jenstroeger
273-
git_user_email: jenstroeger@users.noreply.github.com
268+
to-head: staging
269+
from-base: origin/main
270+
git-user-name: jenstroeger
271+
git-user-email: jenstroeger@users.noreply.github.com
274272
secrets:
275273
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)