https://github.com/vil02/string_to_code_action
https://github.com/vil02/string_to_code_action
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vil02/string_to_code_action
- Owner: vil02
- License: mit
- Created: 2023-10-27T20:22:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-05T07:55:13.000Z (5 months ago)
- Last Synced: 2025-02-05T08:33:22.300Z (5 months ago)
- Language: Python
- Size: 158 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `string_to_code_action`
[](https://sonarcloud.io/summary/new_code?id=vil02_string_to_code_action)
[](https://www.codefactor.io/repository/github/vil02/string_to_code_action)
[](https://app.codacy.com/gh/vil02/string_to_code_action/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://gitpod.io/#https://github.com/vil02/string_to_code_action)This GitHub Action utilizes the
[`string_to_code`](https://github.com/vil02/string_to_code_proj) Python package
to generate messy code that displays a given string.## Inputs
- `targetLanguage` (optional): Language of the generated code.
If set to `""` the resulting code will be in a randomly selected language.
Default: `""`.
- `inputStr` (required): The string which should be displayed
by the generated program.
- `outputFile` (optional): The file to store the generated code.
Default: `"out.txt"`.## Outputs
- `targetLanguage`: Language of the generated code.
- `code`: The generated messy code.## Example Usage
```yaml
---
name: Generate Messy Codeon:
workflow_dispatch:
push:jobs:
generate_code:
runs-on: ubuntu-lateststeps:
- name: Checkout repository
uses: actions/checkout@v4- name: Generate Messy Code
id: generate_code
uses: vil02/string_to_code_action
with:
targetLanguage: "python3"
inputStr: "Hello, World!"
outputFile: "generated_code.py"- name: Display Generated Code
run: cat ${{ steps.generate_code.outputs.outputFile }}
...
```In this example, the GitHub Action generates messy code in
the Python3 that displays the string `Hello, World!`.
The generated code is stored in the file `generated_code.py`
and then displayed using the `cat` command.