Skip to content

Commit ae750b7

Browse files
committed
Add support for env vars
1 parent 21feb40 commit ae750b7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/swift_package_test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ on:
2323
type: string
2424
description: "Command to execute before building the Swift package"
2525
default: ""
26+
env_vars:
27+
description: "List of environment variables."
28+
type: string
2629

2730
jobs:
2831
build:
@@ -40,6 +43,13 @@ jobs:
4043
steps:
4144
- name: Checkout repository
4245
uses: actions/checkout@v4
46+
- name: Set environment variables
47+
if: ${{ inputs.env_vars }}
48+
run: |
49+
for i in "${{ inputs.env_vars }}"
50+
do
51+
printf "%s\n" $i >> $GITHUB_ENV
52+
done
4353
- name: Pre-build
4454
run: ${{ inputs.pre_build_command }}
4555
- name: Build Swift Package

0 commit comments

Comments
 (0)