Skip to content

Commit ea33c71

Browse files
committed
docs: update the usage
1 parent e744c5e commit ea33c71

File tree

2 files changed

+52
-22
lines changed

2 files changed

+52
-22
lines changed

README.md

+51-21
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,69 @@
1-
# setup-my-action
1+
# Example GitHub Action Using Golang
22

33
[![CI](https://github.com/pplmx/setup-my-action/workflows/CI/badge.svg)](https://github.com/pplmx/setup-my-action/actions)
44
[![Coverage Status](https://coveralls.io/repos/github/pplmx/setup-my-action/badge.svg?branch=main)](https://coveralls.io/github/pplmx/setup-my-action?branch=main)
55

6+
## Overview
7+
8+
**Example GitHub Action Using Golang** is a custom GitHub Action designed to handle text processing, lists, files, and
9+
API requests efficiently using Go. The action is configured using a TOML file and runs inside a Docker container.
10+
11+
## Features
12+
13+
- **Text Processing**: Perform find-and-replace operations on provided text.
14+
- **List Operations**: Calculate word count, sum, and average for provided data.
15+
- **API Requests**: Fetch data from APIs and extract specific fields.
16+
- **Configuration**: Fully configurable via a TOML file.
17+
18+
## Inputs
19+
20+
| Name | Description | Required | Default |
21+
|---------------|-------------------------------------|----------|----------------------------------------|
22+
| `config_path` | Path to the TOML configuration file | No | `.github/configs/setup-my-action.toml` |
23+
24+
## Outputs
25+
26+
| Name | Description |
27+
|------------------|-------------------------------------------|
28+
| `processed_text` | The processed text after find and replace |
29+
| `word_count` | The total number of words in the text |
30+
| `sum` | The sum of the numbers |
31+
| `average` | The average of the numbers |
32+
| `response_field` | A specific field from the API response |
33+
634
## Usage
735

8-
```bash
9-
# initialize the project
10-
make init
36+
To use this GitHub Action in your workflow, you can define a step that utilizes it. Here's an example:
1137

12-
# run the server
13-
make run
38+
```yaml
39+
name: Example Workflow
40+
on: [ push ]
1441

15-
# build the binary
16-
make build
42+
jobs:
43+
example-job:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
1747

18-
# run with binary
19-
./bin/setup-my-action
48+
- name: Run Example GitHub Action Using Golang
49+
uses: pplmx/setup-my-action@v1
2050
```
2151
22-
## License
52+
You can also follow [this](.github/workflows/ci.yml).
2353
24-
Licensed under either of
54+
## Local Development
55+
56+
For instructions on setting up a local development environment and testing this GitHub Action, please refer to the [Development Documentation](docs/development.md).
57+
58+
## License
2559
26-
- Apache License, Version 2.0
27-
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
28-
- MIT license
29-
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
60+
This project is dual-licensed under either of the following licenses, at your option:
3061
31-
at your option.
62+
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))
63+
- MIT license ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))
3264
3365
## Contribution
3466
35-
Unless you explicitly state otherwise, any contribution intentionally submitted
36-
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
37-
dual licensed as above, without any additional terms or conditions.
67+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
3868
39-
See [CONTRIBUTING.md](CONTRIBUTING.md).
69+
For more details, see [CONTRIBUTING.md](CONTRIBUTING.md).

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Comprehensive GitHub Action by Golang with TOML Config'
1+
name: 'Example GitHub Action Using Golang'
22
description: 'A GitHub Action that handles text, lists, files, and API requests using Go, configured via TOML'
33
author: 'Mystic'
44
branding:

0 commit comments

Comments
 (0)