11# TestifySec Action Wrapper
22
3- A GitHub Action that downloads and executes another GitHub Action dynamically with optional strace instrumentation .
3+ A GitHub Action that downloads and executes another GitHub Action dynamically with optional command wrapping ( strace, time, perf, etc.) .
44
55## Usage
66
@@ -15,22 +15,24 @@ jobs:
1515 - name : Checkout
1616 uses : actions/checkout@v3
1717 - name : Run Nested Action via Wrapper
18- uses : testifysec/action-wrapper@v2
18+ uses : testifysec/action-wrapper@v3
1919 with :
2020 action-ref : " actions/hello-world-javascript-action@main"
2121 input-who-to-greet : " World" # Passed to the nested action as who-to-greet
22- enable-strace : " true " # Enable strace instrumentation
22+ wrapper-command : " time -v " # Wrap with the 'time' command to measure performance
2323` ` `
2424
2525## Inputs
2626
2727| Input | Description | Required | Default |
2828|-------|-------------|----------|---------|
2929| ` action-ref` | Reference to the nested action (e.g., owner/repo@ref) | Yes | |
30- | `enable-strace ` | Enable strace instrumentation | No | `true ` |
31- | `strace-options ` | Options to pass to strace | No | `-f -v -s 256 -e trace=file,process,network,signal,ipc,desc,memory ` |
30+ | `wrapper-command ` | Command to wrap around the nested action execution (e.g., ' strace -f', 'time -v', etc.) | No | `strace -f -v -s 256 -e trace=file,process,network,signal,ipc,desc,memory ` |
31+ | `enable-wrapper ` | Enable command wrapping | No | `true ` |
3232| `input-*` | Any input with the prefix `input-` will be passed to the nested action | No | |
3333| `extra-args` | Extra arguments to pass to the nested action (deprecated, use `input-*` instead) | No | |
34+ | `strace-options` | Options to pass to strace (deprecated, use `wrapper-command` instead) | No | |
35+ | `enable-strace` | Enable strace instrumentation (deprecated, use `enable-wrapper` instead) | No | |
3436
3537# ## Passing Inputs to Nested Actions
3638
@@ -43,16 +45,18 @@ To pass inputs to the nested action, prefix them with `input-`. For example:
4345
4446| Output | Description |
4547|--------|-------------|
46- | `strace-log` | Path to the strace output log file. The filename includes timestamp and action name for easy identification. |
48+ | `wrapper-log` | Path to the output log file for the wrapper command. The filename includes timestamp and action name for easy identification. |
49+ | `strace-log` | Path to the strace log file (deprecated, use `wrapper-log` instead). |
4750
4851# # Features
4952
53+ - **Any Command Wrapper**: Wrap actions with any command (strace, time, perf, ltrace, valgrind, etc.)
5054- **Flexible Reference Handling**: Supports both tags (e.g., `v1.0.0`) and branch names (e.g., `main`)
5155- **Smart Extraction**: Intelligently finds the extracted directory even if naming patterns change
5256- **Format Flexibility**: Supports both `action.yml` and `action.yaml` metadata files
5357- **Robust Error Handling**: Attempts alternative download URLs if the first one fails
5458- **Dependency Management**: Automatically installs dependencies for the wrapped action
55- - **Strace Integration **: Optionally traces system calls made by the wrapped action
59+ - **Command Output Logging **: Automatically captures command output to log files when appropriate
5660
5761# # How It Works
5862
@@ -68,77 +72,93 @@ To pass inputs to the nested action, prefix them with `input-`. For example:
68724. **Dependency Installation (Optional):**
6973 If a `package.json` is present in the nested action, it runs `npm install` to install dependencies.
7074
71- 5. **Strace Instrumentation (Optional):**
72- If strace is enabled and available , the action runs the nested action with strace to trace system calls .
75+ 5. **Command Wrapping (Optional):**
76+ If a wrapper command is enabled , the action runs the nested action with the specified command wrapped around it (e.g., strace, time, perf, etc.) .
7377
74786. **Executing the Nested Action:**
75- Finally, the wrapper runs the nested action's entry file using Node.js. Any extra arguments provided via the `extra-args` input are passed along .
79+ Finally, the wrapper runs the nested action's entry file using Node.js with any provided inputs .
7680
7781# # Examples
7882
79- # ## Using with a Tagged Release
83+ # ## Using with a Performance Timer
8084
8185` ` ` yaml
82- - name: Run Release Version
83- uses: testifysec/action-wrapper@v1
86+ - name: Run with Time Measurements
87+ id: time-action
88+ uses: testifysec/action-wrapper@v3
8489 with:
85- action-ref: "actions/[email protected] " 90+ action-ref: "actions/hello-world-javascript-action@main"
91+ wrapper-command: "time -v"
92+ input-who-to-greet: "World"
93+
94+ - name: Upload Time Results
95+ uses: actions/upload-artifact@v4
96+ with:
97+ name: time-logs
98+ path: ${{ steps.time-action.outputs.wrapper-log }}
8699` ` `
87100
88- # ## Using with a Branch
101+ # ## Using with System Call Tracing (Strace)
89102
90103` ` ` yaml
91- - name: Run Latest Version
92- uses: testifysec/action-wrapper@v1
104+ - name: Run with Strace
105+ id: strace-action
106+ uses: testifysec/action-wrapper@v3
93107 with:
94108 action-ref: "actions/hello-world-javascript-action@main"
109+ wrapper-command: "strace -f -v -s 256 -e trace=file,process,network,signal,ipc,desc,memory"
110+ input-who-to-greet: "World"
111+
112+ - name: Upload Strace Results
113+ uses: actions/upload-artifact@v4
114+ with:
115+ name: strace-logs
116+ path: ${{ steps.strace-action.outputs.wrapper-log }}
95117` ` `
96118
97- # ## Passing Inputs to the Nested Action
119+ # ## Using with Memory Profiling (Valgrind)
98120
99121` ` ` yaml
100- - name: Run with Inputs
101- uses: testifysec/action-wrapper@v2
122+ - name: Run with Valgrind
123+ id: valgrind-action
124+ uses: testifysec/action-wrapper@v3
102125 with:
103- action-ref: "some/action@v1"
104- input-username: "octocat"
105- input-token: ${{ secrets.GITHUB_TOKEN }}
106- input-repository: ${{ github.repository }}
126+ action-ref: "actions/hello-world-javascript-action@main"
127+ wrapper-command: "valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all"
128+ input-who-to-greet: "World"
129+
130+ - name: Upload Valgrind Results
131+ uses: actions/upload-artifact@v4
132+ with:
133+ name: valgrind-logs
134+ path: ${{ steps.valgrind-action.outputs.wrapper-log }}
107135` ` `
108136
109- # ## Using with Strace
137+ # ## Using with Linux Performance Counters (Perf)
110138
111139` ` ` yaml
112- - name: Run with Strace
113- id: strace -action
114- uses: testifysec/action-wrapper@v2.1.2
140+ - name: Run with Perf
141+ id: perf -action
142+ uses: testifysec/action-wrapper@v3
115143 with:
116144 action-ref: "actions/hello-world-javascript-action@main"
117- enable-strace: "true"
118- # Comprehensive tracing with improved verbosity
119- strace-options: "-f -v -s 256 -e trace=file,process,network,signal,ipc,desc,memory"
120- input-who-to-greet: "World" # Passed to the nested action as who-to-greet
145+ wrapper-command: "perf stat -e cycles,instructions,cache-references,cache-misses"
146+ input-who-to-greet: "World"
121147
122- - name: Upload Strace Results
148+ - name: Upload Perf Results
123149 uses: actions/upload-artifact@v4
124150 with:
125- name: strace -logs
126- path: ${{ steps.strace -action.outputs.strace -log }}
151+ name: perf -logs
152+ path: ${{ steps.perf -action.outputs.wrapper -log }}
127153` ` `
128154
129- The strace log will include a helpful header with :
130- - Action reference
131- - Timestamp
132- - Command executed
133- - Strace options used
134-
135- # ## Disabling Strace
155+ # ## Running Without Any Wrapper
136156
137157` ` ` yaml
138- - name: Run Without Strace
139- uses: testifysec/action-wrapper@v2
158+ - name: Run Direct (No Wrapper)
159+ uses: testifysec/action-wrapper@v3
140160 with:
141161 action-ref: "actions/hello-world-javascript-action@main"
142- enable-strace : "false"
143- input-who-to-greet: "World" # Passed to the nested action as who-to-greet
144- ` ` `
162+ enable-wrapper : "false"
163+ input-who-to-greet: "World"
164+ ` ` `
0 commit comments