Skip to content

Commit

Permalink
Check for environment variable before checking GitHub input
Browse files Browse the repository at this point in the history
  • Loading branch information
pflooky committed Jun 24, 2024
1 parent 5bc0a92 commit 3bca861
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ runs:
- name: Run integration tests
uses: actions/github-script@v7
with:
configuration-file: ${{ inputs.configuration-file }}
insta-infra-folder: ${{ inputs.insta-infra-folder }}
script: |
const script = require("${{github.action_path}}/dist/index.js")
script({core})
env:
CONFIGURATION_FILE: ${{ inputs.configuration-file }}
INSTA_INFRA_FOLDER: ${{ inputs.insta-infra-folder }}
8 changes: 6 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ const execSync = require('child_process').execSync
*/
async function run() {
try {
const configFile = core.getInput('configuration-file', {})
const instaInfraFolder = core.getInput('insta-infra-folder', {})
const configFile = process.env.CONFIGURATION_FILE
? process.env.CONFIGURATION_FILE
: core.getInput('configuration-file', {})
const instaInfraFolder = process.env.INSTA_INFRA_FOLDER
? process.env.INSTA_INFRA_FOLDER
: core.getInput('insta-infra-folder', {})

// Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
core.debug(`Using config file: ${configFile}`)
Expand Down

0 comments on commit 3bca861

Please sign in to comment.