ci: harden env variable usage (#4266)

This commit is contained in:
ReenigneArcher 2025-09-16 23:37:29 -04:00 committed by GitHub
commit 3239f2e1a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 35 deletions

View file

@ -59,7 +59,7 @@ jobs:
run: ls -l artifacts
- name: Update GitHub Release
uses: LizardByte/actions/actions/release_create@v2025.914.154454
uses: LizardByte/actions/actions/release_create@v2025.917.25039
with:
allowUpdates: true
body: ${{ github.event.release.body }}

View file

@ -32,7 +32,7 @@ jobs:
steps:
- name: More space
if: matrix.arch == 'x86_64'
uses: LizardByte/actions/actions/more_space@v2025.914.154454
uses: LizardByte/actions/actions/more_space@v2025.917.25039
with:
analyze-space-savings: true
clean-all: true
@ -99,23 +99,19 @@ jobs:
- name: Configure Flatpak Manifest
env:
BRANCH: ${{ github.head_ref }}
BRANCH: ${{ github.ref }}
run: |
# variables for manifest
branch="${{ env.BRANCH }}"
build_version=${{ inputs.release_version }}
commit=${{ inputs.release_commit }}
branch="${BRANCH}"
build_version="${{ inputs.release_version }}"
commit="${{ inputs.release_commit }}"
clone_url="${{ github.event.repository.clone_url }}"
# check the branch variable
if [ -z "$branch" ]
then
if [ "${{ github.event_name }}" == "push" ]; then
echo "This is a PUSH event"
branch=${{ github.ref_name }}
clone_url=${{ github.event.repository.clone_url }}
else
echo "This is a PR event"
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
branch="${{ github.ref_name }}"
fi
echo "Branch: ${branch}"
echo "Commit: ${commit}"
echo "Clone URL: ${clone_url}"

View file

@ -79,31 +79,27 @@ jobs:
PR_DEFAULT_BRANCH: ${{ github.event.pull_request.head.repo.default_branch }}
run: |
# variables for formula
branch="${{ env.HEAD_REF }}"
build_version=${{ inputs.release_version }}
commit=${{ inputs.release_commit }}
branch="${HEAD_REF}"
build_version="${{ inputs.release_version }}"
clone_url="${{ github.event.repository.clone_url }}"
commit="${{ inputs.release_commit }}"
default_branch="${{ github.event.repository.default_branch }}"
tag="${{ github.ref_name }}"
# check the branch variable
if [ -z "$branch" ]
then
if [ "${{ github.event_name }}" == "push" ]; then
echo "This is a PUSH event"
clone_url=${{ github.event.repository.clone_url }}
branch="${{ github.ref_name }}"
default_branch="${{ github.event.repository.default_branch }}"
if [ "${{ matrix.release }}" == "true" ]; then
# we will publish the formula with the release tag
tag="${{ inputs.release_tag }}"
else
tag="${{ github.ref_name }}"
fi
else
elif [ "${{ github.event_name }}" == "pull_request" ]; then
echo "This is a PR event"
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
branch="${{ env.PR_HEAD_REF }}"
default_branch="${{ env.PR_DEFAULT_BRANCH }}"
tag="${{ env.PR_HEAD_REF }}"
branch="${PR_HEAD_REF}"
default_branch="${PR_DEFAULT_BRANCH}"
tag="${PR_HEAD_REF}"
fi
echo "Branch: ${branch}"
echo "Clone URL: ${clone_url}"
echo "Tag: ${tag}"
@ -153,7 +149,7 @@ jobs:
- name: Validate Homebrew Formula
id: test
if: matrix.release != true
uses: LizardByte/actions/actions/release_homebrew@v2025.914.154454
uses: LizardByte/actions/actions/release_homebrew@v2025.917.25039
with:
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
git_email: ${{ secrets.GIT_EMAIL }}

View file

@ -28,7 +28,7 @@ jobs:
dist: 22.04
steps:
- name: More space
uses: LizardByte/actions/actions/more_space@v2025.914.154454
uses: LizardByte/actions/actions/more_space@v2025.917.25039
with:
analyze-space-savings: true
clean-all: true

View file

@ -43,7 +43,8 @@ jobs:
- name: Release Setup
id: release-setup
uses: LizardByte/actions/actions/release_setup@v2025.914.154454
uses: LizardByte/actions/actions/release_setup@v2025.917.25039
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
@ -202,7 +203,7 @@ jobs:
run: ls -l artifacts
- name: Create/Update GitHub Release
uses: LizardByte/actions/actions/release_create@v2025.914.154454
uses: LizardByte/actions/actions/release_create@v2025.917.25039
with:
allowUpdates: false
body: ${{ needs.release-setup.outputs.release_body }}
@ -231,7 +232,7 @@ jobs:
path: homebrew
- name: Upload Homebrew Beta Formula
uses: LizardByte/actions/actions/release_homebrew@v2025.914.154454
uses: LizardByte/actions/actions/release_homebrew@v2025.917.25039
with:
formula_file: ${{ github.workspace }}/homebrew/sunshine-beta.rb
git_email: ${{ secrets.GH_BOT_EMAIL }}