|
1 |
| -# setup-my-action |
| 1 | +# Example GitHub Action Using Golang |
2 | 2 |
|
3 | 3 | [](https://github.com/pplmx/setup-my-action/actions)
|
4 | 4 | [](https://coveralls.io/github/pplmx/setup-my-action?branch=main)
|
5 | 5 |
|
| 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 | + |
6 | 34 | ## Usage
|
7 | 35 |
|
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: |
11 | 37 |
|
12 |
| -# run the server |
13 |
| -make run |
| 38 | +```yaml |
| 39 | +name: Example Workflow |
| 40 | +on: [ push ] |
14 | 41 |
|
15 |
| -# build the binary |
16 |
| -make build |
| 42 | +jobs: |
| 43 | + example-job: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
17 | 47 |
|
18 |
| -# run with binary |
19 |
| -./bin/setup-my-action |
| 48 | + - name: Run Example GitHub Action Using Golang |
| 49 | + uses: pplmx/setup-my-action@v1 |
20 | 50 | ```
|
21 | 51 |
|
22 |
| -## License |
| 52 | +You can also follow [this](.github/workflows/ci.yml). |
23 | 53 |
|
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 |
25 | 59 |
|
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: |
30 | 61 |
|
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)) |
32 | 64 |
|
33 | 65 | ## Contribution
|
34 | 66 |
|
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. |
38 | 68 |
|
39 |
| -See [CONTRIBUTING.md](CONTRIBUTING.md). |
| 69 | +For more details, see [CONTRIBUTING.md](CONTRIBUTING.md). |
0 commit comments