Skip to content

Commit 3239f2e

Browse files
ci: harden env variable usage (#4266)
1 parent 9f6c832 commit 3239f2e

5 files changed

Lines changed: 29 additions & 36 deletions

File tree

.github/workflows/ci-copr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
run: ls -l artifacts
6060

6161
- name: Update GitHub Release
62-
uses: LizardByte/actions/actions/release_create@v2025.914.154454
62+
uses: LizardByte/actions/actions/release_create@v2025.917.25039
6363
with:
6464
allowUpdates: true
6565
body: ${{ github.event.release.body }}

.github/workflows/ci-flatpak.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
steps:
3333
- name: More space
3434
if: matrix.arch == 'x86_64'
35-
uses: LizardByte/actions/actions/more_space@v2025.914.154454
35+
uses: LizardByte/actions/actions/more_space@v2025.917.25039
3636
with:
3737
analyze-space-savings: true
3838
clean-all: true
@@ -99,23 +99,19 @@ jobs:
9999
100100
- name: Configure Flatpak Manifest
101101
env:
102-
BRANCH: ${{ github.head_ref }}
102+
BRANCH: ${{ github.ref }}
103103
run: |
104104
# variables for manifest
105-
branch="${{ env.BRANCH }}"
106-
build_version=${{ inputs.release_version }}
107-
commit=${{ inputs.release_commit }}
105+
branch="${BRANCH}"
106+
build_version="${{ inputs.release_version }}"
107+
commit="${{ inputs.release_commit }}"
108+
clone_url="${{ github.event.repository.clone_url }}"
108109
109-
# check the branch variable
110-
if [ -z "$branch" ]
111-
then
110+
if [ "${{ github.event_name }}" == "push" ]; then
112111
echo "This is a PUSH event"
113-
branch=${{ github.ref_name }}
114-
clone_url=${{ github.event.repository.clone_url }}
115-
else
116-
echo "This is a PR event"
117-
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
112+
branch="${{ github.ref_name }}"
118113
fi
114+
119115
echo "Branch: ${branch}"
120116
echo "Commit: ${commit}"
121117
echo "Clone URL: ${clone_url}"

.github/workflows/ci-homebrew.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,27 @@ jobs:
7979
PR_DEFAULT_BRANCH: ${{ github.event.pull_request.head.repo.default_branch }}
8080
run: |
8181
# variables for formula
82-
branch="${{ env.HEAD_REF }}"
83-
build_version=${{ inputs.release_version }}
84-
commit=${{ inputs.release_commit }}
85-
86-
# check the branch variable
87-
if [ -z "$branch" ]
88-
then
82+
branch="${HEAD_REF}"
83+
build_version="${{ inputs.release_version }}"
84+
clone_url="${{ github.event.repository.clone_url }}"
85+
commit="${{ inputs.release_commit }}"
86+
default_branch="${{ github.event.repository.default_branch }}"
87+
tag="${{ github.ref_name }}"
88+
89+
if [ "${{ github.event_name }}" == "push" ]; then
8990
echo "This is a PUSH event"
90-
clone_url=${{ github.event.repository.clone_url }}
91-
branch="${{ github.ref_name }}"
92-
default_branch="${{ github.event.repository.default_branch }}"
93-
9491
if [ "${{ matrix.release }}" == "true" ]; then
9592
# we will publish the formula with the release tag
9693
tag="${{ inputs.release_tag }}"
97-
else
98-
tag="${{ github.ref_name }}"
9994
fi
100-
else
95+
elif [ "${{ github.event_name }}" == "pull_request" ]; then
10196
echo "This is a PR event"
10297
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
103-
branch="${{ env.PR_HEAD_REF }}"
104-
default_branch="${{ env.PR_DEFAULT_BRANCH }}"
105-
tag="${{ env.PR_HEAD_REF }}"
98+
branch="${PR_HEAD_REF}"
99+
default_branch="${PR_DEFAULT_BRANCH}"
100+
tag="${PR_HEAD_REF}"
106101
fi
102+
107103
echo "Branch: ${branch}"
108104
echo "Clone URL: ${clone_url}"
109105
echo "Tag: ${tag}"
@@ -153,7 +149,7 @@ jobs:
153149
- name: Validate Homebrew Formula
154150
id: test
155151
if: matrix.release != true
156-
uses: LizardByte/actions/actions/release_homebrew@v2025.914.154454
152+
uses: LizardByte/actions/actions/release_homebrew@v2025.917.25039
157153
with:
158154
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
159155
git_email: ${{ secrets.GIT_EMAIL }}

.github/workflows/ci-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
dist: 22.04
2929
steps:
3030
- name: More space
31-
uses: LizardByte/actions/actions/more_space@v2025.914.154454
31+
uses: LizardByte/actions/actions/more_space@v2025.917.25039
3232
with:
3333
analyze-space-savings: true
3434
clean-all: true

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ jobs:
4343

4444
- name: Release Setup
4545
id: release-setup
46-
uses: LizardByte/actions/actions/release_setup@v2025.914.154454
46+
uses: LizardByte/actions/actions/release_setup@v2025.917.25039
47+
4748
with:
4849
github_token: ${{ secrets.GITHUB_TOKEN }}
4950

@@ -202,7 +203,7 @@ jobs:
202203
run: ls -l artifacts
203204

204205
- name: Create/Update GitHub Release
205-
uses: LizardByte/actions/actions/release_create@v2025.914.154454
206+
uses: LizardByte/actions/actions/release_create@v2025.917.25039
206207
with:
207208
allowUpdates: false
208209
body: ${{ needs.release-setup.outputs.release_body }}
@@ -231,7 +232,7 @@ jobs:
231232
path: homebrew
232233

233234
- name: Upload Homebrew Beta Formula
234-
uses: LizardByte/actions/actions/release_homebrew@v2025.914.154454
235+
uses: LizardByte/actions/actions/release_homebrew@v2025.917.25039
235236
with:
236237
formula_file: ${{ github.workspace }}/homebrew/sunshine-beta.rb
237238
git_email: ${{ secrets.GH_BOT_EMAIL }}

0 commit comments

Comments
 (0)