Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ runs:
shell: bash

- id: install
env:
GIT_USER: ${{ inputs.git-user }}
GIT_USER_EMAIL: ${{ inputs.git-user-email }}
run: ${GITHUB_ACTION_PATH}/install.sh
shell: bash

Expand All @@ -62,7 +65,5 @@ runs:
if: ${{ inputs.install-only != 'true' }}
run: |
${GITHUB_ACTION_PATH}/cog.sh \
"${{ inputs.git-user }}" \
"${{ inputs.git-user-email }}" \
"${{ inputs.command }}" \
"${{ inputs.args }}"
13 changes: 3 additions & 10 deletions cog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@

set -a

GIT_USER="${1}"
GIT_USER_EMAIL="${2}"
COMMAND="${3}"
ARGS="${4}"

echo "Setting git user : ${GIT_USER}"
git config --global user.name "${GIT_USER}"

echo "Setting git user email ${GIT_USER_EMAIL}"
git config --global user.email "${GIT_USER_EMAIL}"
COMMAND="${1}"
shift
ARGS="${*}"

cog --version

Expand Down
10 changes: 10 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@ else
tar --strip-components=1 -xzf $TAR "$ARCH-$PLATFORM/cog"
fi
cd "$CUR_DIR" || exit

if ! git config --get user.name; then
echo "Setting git user : ${GIT_USER}"
git config --global user.name "${GIT_USER}"
fi

if ! git config --get user.email; then
echo "Setting git email : ${GIT_USER_EMAIL}"
git config --global user.email "${GIT_USER_EMAIL}"
fi