Skip to content

Commit

Permalink
Permit use of action in all other repositories (#4)
Browse files Browse the repository at this point in the history
* action.yml: force use external syntax for `uses`

This forces the use of the syntax for `uses` calling a specified subfolder of a public repository at a given ref. This is an attempt at moving away from the use of `./` as a path, which forces GitHub Actions to locate the `util/post/action.yml` of the *working directory* and not of the action path. This exists since `uses` cannot take expressions; this would be an easy fix if `./` can be replaced with `${{ github.action_path }}/`. Alas, this is not possible, and this hacky workaround exists instead.

* action.yml: use `action_path` instead of `./`

This replaces the use of `./` with `${{ github.action_path }}`, to allow the install scripts to run outside the action's repository, see b1b5340 for related commit.

* action.yml: wrap pwsh argument in quotes
  • Loading branch information
ChlodAlejandro authored Dec 23, 2022
1 parent 7ede239 commit b72522a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
using: 'composite'
steps:
- name: zerotier
uses: ./util/post
uses: zerotier/github-action/util/post@main
with:
main: |
set -euo pipefail
Expand All @@ -33,12 +33,12 @@ runs:
case $(uname -s) in
MINGW64_NT?*)
pwsh ./util/install.ps1
pwsh "${{ github.action_path }}/util/install.ps1"
ztcli="/c/Program Files (x86)/ZeroTier/One/zerotier-cli.bat"
member_id=$("${ztcli}" info | awk '{ print $3 }')
;;
*)
. ./util/install.sh &>/dev/null
. ${{ github.action_path }}/util/install.sh &>/dev/null
member_id=$(sudo zerotier-cli info | awk '{ print $3 }')
;;
esac
Expand Down

0 comments on commit b72522a

Please sign in to comment.