https://github.com/matchai/rust-container-action
A template for creating GitHub Actions in Rust
https://github.com/matchai/rust-container-action
Last synced: 5 months ago
JSON representation
A template for creating GitHub Actions in Rust
- Host: GitHub
- URL: https://github.com/matchai/rust-container-action
- Owner: matchai
- License: isc
- Created: 2020-01-07T03:13:05.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-25T02:13:37.000Z (almost 6 years ago)
- Last Synced: 2025-03-11T02:25:25.072Z (10 months ago)
- Language: Dockerfile
- Size: 11.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust Container Action Template
[](https://github.com/matchai/rust-container-action)
[](https://github.com/matchai/rust-container-action/actions)
[](https://github.com/matchai/rust-container-action/actions)
This is a template for creating GitHub actions and contains a small Rust application which will be built into a minimal [Container Action](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-a-docker-container-action). Our final container from this template is ~2MB, yours may be a little bigger once you add some code, but it'll still be tiny!
In `src/main.rs` you will find a small example of accessing Action inputs and returning Action outputs. For more information on communicating with the workflow see the [development tools for GitHub Actions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions).
> 🏁 To get started, click the `Use this template` button on this repository [which will create a new repository based on this template](https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/).
## Usage
Describe how to use your action here.
### Example workflow
```yaml
name: My Workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run action
# Put your action repo here
uses: me/myaction@master
# Put an example of your mandatory inputs here
with:
myInput: world
```
### Inputs
| Input | Description |
| --------------------------- | -------------------------- |
| `myInput` | An example mandatory input |
| `anotherInput` _(optional)_ | An example optional input |
### Outputs
| Output | Description |
| ---------- | ----------------------------------------- |
| `myOutput` | An example output (returns 'Hello world') |
## Examples
> NOTE: People ❤️ cut and paste examples. Be generous with them!
### Using the optional input
This is how to use the optional input.
```yaml
with:
myInput: world
anotherInput: optional
```
### Using outputs
Show people how to use your outputs in another action.
```yaml
steps:
- uses: actions/checkout@master
- name: Run action
id: myaction
# Put your action name here
uses: me/myaction@master
# Put an example of your mandatory arguments here
with:
myInput: world
# Put an example of using your outputs here
- name: Check outputs
run: |
echo "Outputs - ${{ steps.myaction.outputs.myOutput }}"
```