diff --git a/action.yml b/action.yml index 1ed61862..40ef41b7 100644 --- a/action.yml +++ b/action.yml @@ -65,6 +65,27 @@ inputs: If not set this option, the GITHUB_REF environment variable (automatically set by GitHub Actions) will be used. required: false +# Note: +# - inputs.* should be manually mapped to INPUT_* due to https://github.com/actions/runner/issues/665 +# - Use GITHUB_*/RUNNER_* instead of github.*/runner.* due to https://github.com/actions/runner/issues/2185 runs: - using: node16 - main: main.js + using: composite + steps: + - run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh" + shell: bash + env: + INPUT_BIN: ${{ inputs.bin }} + INPUT_ARCHIVE: ${{ inputs.archive }} + INPUT_TARGET: ${{ inputs.target }} + INPUT_FEATURES: ${{ inputs.features }} + INPUT_NO_DEFAULT_FEATURES: ${{ inputs.no_default_features }} + INPUT_MANIFEST_PATH: ${{ inputs.manifest_path }} + INPUT_TAR: ${{ inputs.tar }} + INPUT_ZIP: ${{ inputs.zip }} + INPUT_INCLUDE: ${{ inputs.include }} + INPUT_ASSET: ${{ inputs.asset }} + INPUT_LEADING_DIR: ${{ inputs.leading_dir }} + INPUT_BUILD_TOOL: ${{ inputs.build_tool }} + INPUT_CHECKSUM: ${{ inputs.checksum }} + INPUT_TOKEN: ${{ inputs.token }} + INPUT_REF: ${{ inputs.ref }} diff --git a/main.js b/main.js deleted file mode 100644 index 804c20d2..00000000 --- a/main.js +++ /dev/null @@ -1,28 +0,0 @@ -// This is a script that just calls the bash script that does the main -// processing of the action. It works like a composite action that calls -// a single bash script. -// -// This was originally a trick adopted to make bash script-based actions work -// without docker before composite actions were supported. However, due to -// various problems with composite actions, this trick is still needed: -// - https://github.com/actions/runner/issues/665 -// - https://github.com/actions/runner/issues/2185 -// Although there are ways to work around these like cache-cargo-install-action does: -// https://github.com/taiki-e/cache-cargo-install-action/blob/v1.0.1/action.yml#L9-L11 - -const { execFileSync } = require('child_process'); - -function main() { - try { - execFileSync( - 'bash', - ['--noprofile', '--norc', `${__dirname}/main.sh`], - { stdio: 'inherit' } - ); - } catch (e) { - console.log(`::error::${e.message}`); - process.exit(1); - } -} - -main();