Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 8c029d6

Browse files
committed
fix: allow workflow_call.secrets values to be empty
1 parent 926abb2 commit 8c029d6

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

src/workflow/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub struct WorkflowCall {
183183
#[serde(default)]
184184
pub outputs: IndexMap<String, WorkflowCallOutput>,
185185
#[serde(default)]
186-
pub secrets: IndexMap<String, WorkflowCallSecret>,
186+
pub secrets: IndexMap<String, Option<WorkflowCallSecret>>,
187187
}
188188

189189
/// A single input in a `workflow_call` event trigger body.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# https://raw.githubusercontent.com/mhils/workflows/0d7c124ffff22d26be111477a3ed9fadd853a6db/.github/workflows/python-deploy.yml
2+
3+
# MIT License
4+
5+
# Copyright (c) 2022 Maximilian Hils
6+
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
14+
# The above copyright notice and this permission notice shall be included in all
15+
# copies or substantial portions of the Software.
16+
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
# SOFTWARE.
24+
25+
# Usage:
26+
#
27+
# deploy:
28+
# uses: mhils/workflows/.github/workflows/python-deploy.yml@main
29+
# needs: check
30+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
31+
# secrets:
32+
# password: ${{ secrets.PYPI_TOKEN }}
33+
34+
permissions:
35+
contents: read
36+
37+
on:
38+
workflow_call:
39+
inputs:
40+
environment:
41+
type: string
42+
artifact-name:
43+
type: string
44+
artifact-pattern:
45+
type: string
46+
artifact-merge-multiple:
47+
type: boolean
48+
repository:
49+
type: string
50+
secrets:
51+
username:
52+
password:
53+
required: true
54+
55+
jobs:
56+
deploy:
57+
environment: ${{ inputs.environment || 'deploy' }}
58+
env:
59+
TWINE_USERNAME: ${{ secrets.username || '__token__' }}
60+
TWINE_PASSWORD: ${{ secrets.password }}
61+
TWINE_REPOSITORY: ${{ inputs.repository || 'pypi' }}
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Install twine from PyPI
65+
uses: install-pinned/twine@6aec23fc537538d8e480e593660afa49a377c224 # 5.0.0
66+
- uses: actions/download-artifact@v4
67+
with:
68+
name: ${{ inputs.artifact-name }}
69+
pattern: ${{ inputs.artifact-pattern }}
70+
merge-multiple: ${{ inputs.artifact-merge-multiple }}
71+
path: dist/
72+
- run: twine check dist/*
73+
- run: twine upload dist/*

0 commit comments

Comments
 (0)