Skip to content

Commit

Permalink
automated the git info
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhinav-26 committed Jul 31, 2024
1 parent 88dc62a commit c852814
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
4 changes: 4 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ runs:
MESSAGE: ${{ inputs.MESSAGE }}
AUTHOR_NAME: ${{ inputs.AUTHOR_NAME }}
COMMIT_TIME: ${{ inputs.COMMIT_TIME }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_MESSAGE: ${{ github.event.head_commit.message }}
GITHUB_AUTHOR: ${{ github.event.head_commit.author.name }}
GITHUB_COMMIT_TIME: ${{ github.event.head_commit.timestamp }}
branding:
icon: 'rocket'
color: 'blue'
26 changes: 6 additions & 20 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,16 @@

set -e

# Use GitHub context variables if inputs are not provided
COMMIT_HASH=${COMMIT_HASH:-$GITHUB_SHA}
MESSAGE=${MESSAGE:-$GITHUB_MESSAGE}
AUTHOR_NAME=${AUTHOR_NAME:-$GITHUB_AUTHOR}
COMMIT_TIME=${COMMIT_TIME:-$GITHUB_COMMIT_TIME}

DEVTRON_URL=${DEVTRON_URL}
DEVTRON_API_TOKEN=${DEVTRON_API_TOKEN}
IMAGE=${IMAGE}
ID=${ID}
COMMIT_HASH=${COMMIT_HASH}
MESSAGE=${MESSAGE}
AUTHOR_NAME=${AUTHOR_NAME}
COMMIT_TIME=${COMMIT_TIME}

if [ -z "$COMMIT_HASH" ]; then
COMMIT_HASH=""
fi

if [ -z "$MESSAGE" ]; then
MESSAGE=""
fi

if [ -z "$AUTHOR_NAME" ]; then
AUTHOR_NAME=""
fi

if [ -z "$COMMIT_TIME" ]; then
COMMIT_TIME=""
fi

jsonData=$(cat <<EOF
{
Expand Down

0 comments on commit c852814

Please sign in to comment.