Skip to content

Commit

Permalink
fix: use github.action_path
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Mar 19, 2023
1 parent f4457ef commit 4843187
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 2 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ inputs:
- make
template:
description: "Path to a rockspec template."
required: true
default: "resources/rockspec.template"
required: false
upload:
description: |
Whether to upload to LuaRocks.
Expand All @@ -64,9 +63,7 @@ runs:
using: "composite"
steps:
- uses: cachix/install-nix-action@v20
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- run: nix profile install ".#luarocks-tag-release-action"
- run: nix profile install "${{ github.action_path }}#luarocks-tag-release-action"
shell: bash
- run: luarocks-tag-release-action
env:
Expand Down
5 changes: 4 additions & 1 deletion bin/luarocks-tag-release-action.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ local function getenv_or_empty(env_var)
return os.getenv(env_var) or ''
end

local action_path = getenv_or_err('GITHUB_ACTION_PATH')

local github_repo = getenv_or_err('GITHUB_REPOSITORY')

local repo_name = assert(
Expand Down Expand Up @@ -85,6 +87,7 @@ local function parse_copy_directory_args(str_args)
end

local license_input = os.getenv('INPUT_LICENSE')
local template_input = os.getenv('INPUT_TEMPLATE')

---@type Args
local args = {
Expand All @@ -99,7 +102,7 @@ local args = {
summary = getenv_or_empty('INPUT_SUMMARY'),
detailed_description_lines = parse_list_args(getenv_or_empty('INPUT_DETAILED_DESCRIPTION')),
build_type = getenv_or_err('INPUT_BUILD_TYPE'),
rockspec_template_file_path = getenv_or_err('INPUT_TEMPLATE'),
rockspec_template_file_path = template_input or action_path .. '/resources/rockspec.template',
upload = getenv_or_err('INPUT_UPLOAD') == 'true',
license = license_input ~= '' and license_input or nil,
}
Expand Down

0 comments on commit 4843187

Please sign in to comment.