Skip to content

Commit

Permalink
docs: add example
Browse files Browse the repository at this point in the history
  • Loading branch information
darioblanco committed Jun 10, 2021
1 parent cf8eb9d commit f626dd8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflow-generator.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
global:
values:
renovate_cronjob: '0 7,21 * * 1-5'
workflows:
- pr.yml

Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,40 @@ Generates Github workflows based on YTT templates from a given repository.

For an example, take a look at the `ytt` folder and `.github/workflows/main.yaml`.

## Usage

This action requires `ytt` installed in the runner, and as an output it will generate templated
files that can later be pushed to a PR with another action.

For instance, to generate a PR with Github workflows that are generated with YTT templates stored
in the `ytt` folder, using variables defined in `.github/workflow-generator.yml`:

```yaml
generate_workflows:
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v2
- uses: vmware-tanzu/carvel-setup-action@v1
with:
only: ytt
- name: Generate Workflow
uses: darioblanco/workflow-generator@main
with:
token: ${{ github.token }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
branch: ci/create-workflows
base: main
body: |
Workflows automatically generated by the
[workflow-generator](https://github.com/daroblanco/workflow-generator) GitHub action
labels: ci
title: Change Github Actions Workflows
token: ${{ github.token }}
```

## Development

Install dependencies
Expand Down

0 comments on commit f626dd8

Please sign in to comment.