generated from cloudposse-github-actions/composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.yaml
120 lines (97 loc) · 3.38 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: README Generator
# Tags of this project
tags:
- github-action
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse-github-actions/readme
# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse-github-actions/readme.svg"
url: "https://github.com/cloudposse-github-actions/readme/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
related: []
# Short description of this project
description: |
Rebuilds [`README.md`](README.md) and associated banners from templates using the [`README.yaml`](README.yaml) metadata.
author: [email protected]
introduction: |-
This opinionated implementation builds upon Cloud Posse's build-harness and README.yaml
used throughout Cloud Posse's GitHub repositories.
references:
- name: "screenshot"
description: ""
url: "https://github.com/cloudposse-github-actions/screenshot"
# How to use this project
usage: |-
To use this project, follow these steps:
Add the following code to your workflow file (e.g., `.github/workflows/readme.yml`):
```yaml
name: README
on:
pull_request:
branches: [ 'main' ]
types: [opened, synchronize, reopened, closed, labeled, unlabeled]
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Rebuild README.md and Banner
uses: cloudposse-github-actions/readme@v0
id: readme
with:
banner_enabled: true
readme_enabled: true
outputs:
banner_file: ${{ steps.readme.outputs.banner_file }}
readme_file: ${{ steps.readme.outputs.readme_file }}
```
## Advanced Usage
In the following example, we use the `workflow_dispatch` event to allow manual triggering of the workflow to rebuild the readme.
We also use the `pull_request` event to register the workflow from the PR. This allows us to test the workflow before merging
it to the main branch.
```yaml
name: README
on:
# Allow manual triggering of workflow to rebuild readme
workflow_dispatch: {}
## Added pull_request to register workflow from the PR.
## Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
pull_request:
branches-ignore: ['*']
schedule:
# Update README.md nightly at 4am UTC
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
- cron: '0 4 * * *'
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Rebuild README.md and Banner
uses: cloudposse-github-actions/readme@v0
id: readme
with:
banner_enabled: true
readme_enabled: true
```
include:
- "docs/github-action.md"
# Contributors to this project
contributors: []