Skip to content

Commit

Permalink
Merge pull request #14 from actionshub/variables
Browse files Browse the repository at this point in the history
fix: switch to using INTPUT_ for getting the variables
  • Loading branch information
damacus authored Nov 23, 2023
2 parents c490c83 + 6589cf9 commit 1e1498b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ author: "Dan Webb"
description: "Run publish Gems to Rubygems"
runs:
using: "docker"
image: docker://ghcr.io/actionshub/publish-gem-to-rubygems:v2.0.0
image: docker://ghcr.io/actionshub/publish-gem-to-rubygems:v2.0.1
inputs:
token:
description: "RubyGems API Key"
Expand Down
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/bash

cd "${GITHUB_WORKSPACE}" || exit 1
git config --global --add safe.directory "${GITHUB_WORKSPACE}"

TOKEN="${1}"
TOKEN="${INPUT_TOKEN}"
[ -z "${TOKEN}" ] && { echo "Missing input.token!"; exit 2; }

function setup_credentials_file() {
Expand All @@ -18,13 +17,14 @@ function auth_rubygems() {
echo ":rubygems_api_key: ${1}" > ~/.gem/credentials
}

function build() {
function build_and_push() {
cd "${1}" || exit 1
echo "Building gem"
find . -name '*.gemspec' -maxdepth 1 -exec gem build {} \;
echo "Pushing gem to rubygems.org"
find . -name '*.gem' -maxdepth 1 -exec gem push --key "${1}" {} \;
find . -name '*.gem' -maxdepth 1 -exec gem push --key "${2}" {} \;
}

setup_credentials_file
auth_rubygems "${TOKEN}"
build_and_push "rubygems"
build_and_push "${GITHUB_WORKSPACE}" "rubygems"

0 comments on commit 1e1498b

Please sign in to comment.