-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Refactor internal/run-script action
- Loading branch information
Showing
14 changed files
with
58 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ runs: | |
- uses: fortify/github-action/internal/[email protected] | ||
if: ${{ !env._FOD_LOGGED_IN }} | ||
with: | ||
cwd: ${{ github.action_path }} | ||
dir: ${{ github.action_path }} | ||
script: ./fod-login.sh | ||
post: ./fod-logout.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Run a script with optional post-job cleanup | ||
|
||
description: 'Action to execute a bash script, optionally executing another script on job completion. This action should not be used directly, but through internal/run-script.' | ||
|
||
inputs: | ||
script: | ||
description: 'Script to run' | ||
required: true | ||
post: | ||
description: 'Script to run on job completion' | ||
required: false | ||
dir: | ||
description: 'Directory where scripts are located, should usually be set to ${{ github.action_path }}' | ||
required: true | ||
util_dir: | ||
description: 'Directory where utility scripts are located, set automatically by internal/run-script action' | ||
required: true | ||
key: | ||
description: 'Name of the state variable used to detect the post step.' | ||
required: false | ||
default: POST | ||
|
||
runs: | ||
using: 'node20' | ||
main: 'main.js' | ||
post: 'main.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,16 @@ inputs: | |
post: | ||
description: 'Script to run on job completion' | ||
required: false | ||
cwd: | ||
description: 'Script working directory' | ||
required: false | ||
key: | ||
description: 'Name of the state variable used to detect the post step.' | ||
required: false | ||
default: POST | ||
dir: | ||
description: 'Directory where scripts are located, should usually be set to ${{ github.action_path }}' | ||
required: true | ||
|
||
runs: | ||
using: 'node20' | ||
main: 'main.js' | ||
post: 'main.js' | ||
using: composite | ||
steps: | ||
- uses: fortify/github-action/internal/[email protected] | ||
with: | ||
dir: ${{ inputs['dir'] }} | ||
util_dir: ${{ github.action_path }}/util | ||
script: ${{ inputs['script'] }} | ||
post: ${{ inputs['post'] }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
if [ -n "$RUNNER_DEBUG" ]; then | ||
set -v -x | ||
fi | ||
if [ -z "$FCLI_CMD" ]; then | ||
echo "ERROR: fortify/github-action/setup must be run to set up fcli before running this action" | ||
exit 1; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ runs: | |
- uses: fortify/github-action/internal/[email protected] | ||
if: ${{ !env._SC_SAST_LOGGED_IN }} | ||
with: | ||
cwd: ${{ github.action_path }} | ||
dir: ${{ github.action_path }} | ||
script: ./sc-sast-login.sh | ||
post: ./sc-sast-logout.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ runs: | |
- uses: fortify/github-action/internal/[email protected] | ||
if: ${{ !env._SSC_LOGGED_IN }} | ||
with: | ||
cwd: ${{ github.action_path }} | ||
dir: ${{ github.action_path }} | ||
script: ./ssc-login.sh | ||
post: ./ssc-logout.sh | ||
branding: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters