File tree Expand file tree Collapse file tree 3 files changed +60
-1
lines changed
Expand file tree Collapse file tree 3 files changed +60
-1
lines changed Original file line number Diff line number Diff line change 1- # action-test-publish
1+ # Action Test Publish
2+
3+ This repository contains two GitHub Actions for testing:
4+
5+ ## 1. Echo Action
6+
7+ A simple action that echoes a message.
8+
9+ ** Location** : ` echo-action/ `
10+
11+ ** Usage** :
12+ ``` yaml
13+ uses : your-username/action-test-publish/echo-action@main
14+ with :
15+ message : " Your message here" # Optional, defaults to "Hello from GitHub Action!"
16+ ` ` `
17+
18+ ## 2. File Processor Action
19+
20+ An action that processes files with basic operations.
21+
22+ **Location**: ` file-processor-action/`
23+
24+ **Usage**:
25+ ` ` ` yaml
26+ uses: your-username/action-test-publish/file-processor-action@main
27+ with:
28+ file_path: "path/to/file" # Optional, defaults to "README.md"
29+ operation: "count" # Optional: "count" or "print", defaults to "count"
30+ ` ` `
31+
32+ Each action is located in its own directory and can be referenced independently in GitHub workflows.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ name : ' File Processor'
2+ description : ' A simple action that processes files'
3+ branding :
4+ icon : ' file-text'
5+ color : ' green'
6+ inputs :
7+ file_path :
8+ description : ' Path to file to process'
9+ required : false
10+ default : ' README.md'
11+ operation :
12+ description : ' Operation to perform (count, print)'
13+ required : false
14+ default : ' count'
15+ runs :
16+ using : ' composite'
17+ steps :
18+ - name : Process file
19+ run : |
20+ if [ "${{ inputs.operation }}" = "count" ]; then
21+ wc -l "${{ inputs.file_path }}"
22+ elif [ "${{ inputs.operation }}" = "print" ]; then
23+ cat "${{ inputs.file_path }}"
24+ else
25+ echo "Unknown operation: ${{ inputs.operation }}"
26+ exit 1
27+ fi
28+ shell : bash
You can’t perform that action at this time.
0 commit comments