Skip to content

A self-hosted media server and file management system

ci: avoid using user-controlled data in a run block

aminnausin298303c0fcac
diff --git a/.github/workflows/generate-changelog.yml b/.github/workflows/generate-changelog.yml
index d62078a8..795d28e3 100644
--- a/.github/workflows/generate-changelog.yml
+++ b/.github/workflows/generate-changelog.yml
@@ -36,9 +36,12 @@ jobs:
- name: Generate Changelog from Conventional Commits
id: changelog
+ env:
+ CURRENT_TAG: ${{ inputs.tag }}
+ PREVIOUS_TAG: ${{ inputs.previous_tag }}
run: |
- CURRENT_TAG="${{ inputs.tag }}"
- PREVIOUS_TAG="${{ inputs.previous_tag }}"
+ CURRENT_TAG="$CURRENT_TAG"
+ PREVIOUS_TAG="$PREVIOUS_TAG"
if [ -z "$PREVIOUS_TAG" ]; then
echo "No previous tag found, generating full changelog"
@@ -151,10 +154,13 @@ jobs:
fi
- name: Commit CHANGELOG.md
+ env:
+ CURRENT_TAG: ${{ inputs.tag }}
+ BRANCH: ${{ inputs.branch }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
- git diff --staged --quiet || git commit -m "chore: update CHANGELOG for ${{ inputs.tag }}"
- git push origin ${{ inputs.branch }}
+ git diff --staged --quiet || git commit -m "chore: update CHANGELOG for $CURRENT_TAG"
+ git push origin $BRANCH
diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml
index 1145e4e7..788c58a7 100644
--- a/.github/workflows/release-github.yml
+++ b/.github/workflows/release-github.yml
@@ -88,8 +88,10 @@ jobs:
- name: Update .env.docker
if: steps.should_upload.outputs.UPLOAD == 'true'
+ env:
+ DOCKER_TAG: ${{ inputs.docker_tag }}
run: |
- sed -i "s/DOCKER_RELEASE=.*/DOCKER_RELEASE=${{ inputs.docker_tag }}/" docker/.env.docker
+ sed -i "s/DOCKER_RELEASE=.*/DOCKER_RELEASE=$DOCKER_TAG/" docker/.env.docker
- name: Prepare Docker setup packages
if: steps.should_upload.outputs.UPLOAD == 'true'