diff --git a/README.md b/README.md index b375af2..b33dde3 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,11 @@ Following the capabilities of this action: + + subscription + (Optional) The Subscription name or ID + + ## Example usage diff --git a/action.yml b/action.yml index ad9d692..184c62e 100644 --- a/action.yml +++ b/action.yml @@ -41,6 +41,9 @@ inputs: build_args: description: "JSON specifying key=value pairs as as Docker build arguments" required: false + subscription: + description: "The Subscription Name or ID" + required: false runs: using: "docker" image: "Dockerfile" diff --git a/entrypoint.sh b/entrypoint.sh index c667c63..0ce5150 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,6 +17,10 @@ if [ -n "$INPUT_GIT_ACCESS_TOKEN" ]; then GIT_ACCESS_TOKEN_FLAG="${INPUT_GIT_ACCESS_TOKEN}@" fi +if [ -n "$INPUT_SUBSCRIPTION" ]; then + az account set -s $INPUT_SUBSCRIPTION +fi + echo "Building Docker image ${INPUT_REPOSITORY}${IMAGE_PART}:${INPUT_TAG} from ${GITHUB_REPOSITORY} on ${INPUT_BRANCH} and using context ${INPUT_FOLDER} ; and pushing it to ${INPUT_REGISTRY} Azure Container Registry" echo "Logging into azure.."