Skip to content

Commit 4ba1097

Browse files
feat: Created shared workflow for readme generator (#100)
1 parent 5d41248 commit 4ba1097

File tree

3 files changed

+65
-22
lines changed

3 files changed

+65
-22
lines changed

.github/workflows/readme.yml

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,67 @@
11
---
2-
name: Create README.md file
2+
run-name: 'Readme workflow'
33
on:
4-
workflow_call: null
4+
workflow_call:
5+
secrets:
6+
TOKEN:
7+
required: true
8+
description: 'GitHub Token.'
9+
SLACK_WEBHOOK_TERRAFORM:
10+
required: true
11+
description: 'Slack webhook url.'
12+
513
jobs:
6-
readme-create:
7-
name: readme-create
14+
readme-workflow:
815
runs-on: ubuntu-latest
916
steps:
10-
- name: Checkout
17+
- name: Updating GitHub Token
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
20+
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
21+
22+
- name: checkout
1123
uses: actions/checkout@master
12-
- name: Set up Python 3.7
24+
with:
25+
fetch-depth: 0
26+
ref: master
27+
token: ${{ env.GH_TOKEN }}
28+
29+
- name: 'Set up Python 3.7'
1330
uses: actions/setup-python@v4
1431
with:
15-
python-version: 3.x
16-
- name: create readme
17-
uses: clouddrove/[email protected]
32+
python-version: '3.x'
33+
34+
- name: 'create readme'
35+
uses: 'clouddrove/[email protected]'
1836
with:
19-
actions_subcommand: readme
20-
github_token: ${{ secrets.GITHUB }}
37+
actions_subcommand: 'readme'
38+
github_token: '${{ secrets.TOKEN }}'
2139
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
- name: pre-commit check errors
40+
GITHUB_TOKEN: ${{ secrets.TOKEN}}
41+
42+
- name: 'pre-commit check errors'
2443
uses: pre-commit/[email protected]
2544
continue-on-error: true
26-
- name: pre-commit fix erros
45+
46+
- name: 'pre-commit fix erros'
2747
uses: pre-commit/[email protected]
2848
continue-on-error: true
29-
- name: push readme
30-
uses: clouddrove/[email protected]
31-
continue-on-error: true
49+
50+
- name: 'push readme'
51+
uses: 'clouddrove/[email protected]'
3252
with:
33-
actions_subcommand: push
53+
actions_subcommand: 'push'
3454
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
- name: Slack Notification
55+
GITHUB_TOKEN: ${{ secrets.TOKEN}}
56+
57+
- name: 'Slack Notification'
3758
uses: clouddrove/action-slack@v2
3859
with:
3960
status: ${{ job.status }}
4061
fields: repo,author
41-
author_name: CloudDrove
62+
author_name: 'CloudDrove'
4263
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
4465
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }}
4566
if: always()
4667
...

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Above example is just a simple example to call workflow from github shared workf
6565
9. [Infracost workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/infracost.md)
6666
10. [ Deploy Cloudformation Stack workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/deploy-cloudformation.md)
6767
11. [ Deploy Cloudformation Stackset workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/deploy-cloudformation-stackset.md)
68+
12. [ Readme Generation workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/readme.md)
6869
6970
## Feedback
7071
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/github-shared-workflows/issues), or feel free to drop us an email at [[email protected]](mailto:[email protected]).

docs/readme.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## [Readme Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/.github/workflows/readme.yml)
2+
3+
This workflow is used to generate readme for TErraform modules using GitHub Actions. It utilizes the workflows defined in `.github/workflows/readme.yml`
4+
5+
#### Example of a readme workflow
6+
```yaml
7+
name: readme workflow
8+
on:
9+
push:
10+
branches:
11+
- master
12+
paths-ignore:
13+
- 'README.md'
14+
workflow_dispatch:
15+
jobs:
16+
assignee:
17+
uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@master
18+
secrets:
19+
TOKEN : # Provide GitHub token
20+
SLACK_WEBHOOK_TERRAFORM: # Provide slack-webhook url
21+
```

0 commit comments

Comments
 (0)