Skip to content

Commit

Permalink
Avoid running malicious inputs as shell commands in the workflows for…
Browse files Browse the repository at this point in the history
… managing test builds of Custome GitHub actions.
  • Loading branch information
eason9487 committed May 15, 2024
1 parent 95ae802 commit fdf569d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/github-actions-create-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
install-deps: "no"

- name: Create and commit test build
env:
BRANCH_NAME: ${{ github.ref_name }}
run: |
REPO_URL="${{ github.server_url }}/${{ github.repository }}"
BRANCH_NAME="${{ github.ref_name }}"
TEST_BRANCH_NAME="${BRANCH_NAME}-test-build"
.github/scripts/github-actions-create-and-commit-build.sh "$REPO_URL" "$BRANCH_NAME"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/github-actions-delete-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ jobs:
ref: trunk

- name: Delete test build branch
env:
BRANCH_NAME: ${{ format('{0}-test-build', github.event.ref) }}
run: |
BRANCH_NAME="${{ github.event.ref }}-test-build"
REMOTE_BRANCH_NAME="origin/${BRANCH_NAME}"
git fetch --prune --no-tags --depth=1 origin
Expand Down

0 comments on commit fdf569d

Please sign in to comment.