Skip to content

Commit 15a44c2

Browse files
authored
Initial commit
0 parents  commit 15a44c2

13 files changed

+888
-0
lines changed

.github/configs/draft-release.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: '$RESOLVED_VERSION'
3+
version-template: '$MAJOR.$MINOR.$PATCH'
4+
version-resolver:
5+
major:
6+
labels:
7+
- 'major'
8+
minor:
9+
labels:
10+
- 'minor'
11+
- 'enhancement'
12+
patch:
13+
labels:
14+
- 'auto-update'
15+
- 'patch'
16+
- 'fix'
17+
- 'bugfix'
18+
- 'bug'
19+
- 'hotfix'
20+
- 'no-release'
21+
default: 'minor'
22+
23+
categories:
24+
- title: '🚀 Enhancements'
25+
labels:
26+
- 'enhancement'
27+
- 'patch'
28+
- title: '🐛 Bug Fixes'
29+
labels:
30+
- 'fix'
31+
- 'bugfix'
32+
- 'bug'
33+
- 'hotfix'
34+
- title: '🤖 Automatic Updates'
35+
labels:
36+
- 'auto-update'
37+
38+
change-template: |
39+
<details>
40+
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
41+
42+
$BODY
43+
</details>
44+
45+
template: |
46+
$CHANGES
47+
48+
replacers:
49+
# Remove irrelevant information from Renovate bot
50+
- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
51+
replace: ''
52+
# Remove Renovate bot banner image
53+
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
54+
replace: ''

.github/workflows/auto-readme.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "auto-readme"
2+
on:
3+
workflow_dispatch: {}
4+
5+
## Added pull_request to register workflow from the PR.
6+
## Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
7+
pull_request:
8+
branches-ignore: ['*']
9+
10+
schedule:
11+
# Example of job definition:
12+
# .---------------- minute (0 - 59)
13+
# | .------------- hour (0 - 23)
14+
# | | .---------- day of month (1 - 31)
15+
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
16+
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
17+
# | | | | |
18+
# * * * * * user-name command to be executed
19+
20+
# Update README.md nightly at 4am UTC
21+
- cron: '0 4 * * *'
22+
23+
jobs:
24+
update:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
- name: Find default branch name
30+
id: defaultBranch
31+
shell: bash
32+
env:
33+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
34+
run: |
35+
default_branch=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)
36+
printf "::set-output name=defaultBranch::%s\n" "${default_branch}"
37+
printf "defaultBranchRef.name=%s\n" "${default_branch}"
38+
39+
- name: Update readme
40+
shell: bash
41+
id: update
42+
env:
43+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
44+
DEF: "${{ steps.defaultBranch.outputs.defaultBranch }}"
45+
run: |
46+
make init
47+
make readme/build
48+
# Ignore changes if they are only whitespace
49+
if ! git diff --quiet README.md && git diff --ignore-all-space --ignore-blank-lines --quiet README.md; then
50+
git restore README.md
51+
echo Ignoring whitespace-only changes in README
52+
fi
53+
54+
- name: Create Pull Request
55+
# This action will not create or change a pull request if there are no changes to make.
56+
# If a PR of the auto-update/readme branch is open, this action will just update it, not create a new PR.
57+
uses: cloudposse/actions/github/[email protected]
58+
with:
59+
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
60+
commit-message: Update README.md and docs
61+
title: Update README.md and docs
62+
body: |-
63+
## what
64+
This is an auto-generated PR that updates the README.md and docs
65+
66+
## why
67+
To have most recent changes of README.md and doc from origin templates
68+
69+
branch: auto-update/readme
70+
base: ${{ steps.defaultBranch.outputs.defaultBranch }}
71+
delete-branch: true
72+
labels: |
73+
auto-update
74+
no-release
75+
readme

.github/workflows/feature-branch.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Feature branch
2+
on:
3+
pull_request:
4+
branches: [ main ]
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
perform:
9+
uses: cloudposse/github-actions-workflows-github-action-composite/.github/workflows/feature-branch.yml@main
10+
with:
11+
organization: "${{ github.event.repository.owner.login }}"
12+
repository: "${{ github.event.repository.name }}"
13+
ref: "${{ github.event.pull_request.head.ref }}"
14+
secrets:
15+
github-private-actions-pat: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"

.github/workflows/main-branch.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Main branch
2+
on:
3+
push:
4+
branches: [ main ]
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
perform:
11+
uses: cloudposse/github-actions-workflows-github-action-composite/.github/workflows/main-branch.yml@main
12+
with:
13+
organization: "${{ github.event.repository.owner.login }}"
14+
repository: "${{ github.event.repository.name }}"
15+
secrets:
16+
github-private-actions-pat: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"

.github/workflows/test-negative.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test example negative
2+
on:
3+
# # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
4+
# #
5+
# # Added pull_request to register workflow from the PR.
6+
# # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
7+
# pull_request: {}
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
setup:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Setup
15+
run: echo "Do setup"
16+
17+
test:
18+
runs-on: ubuntu-latest
19+
needs: [setup]
20+
continue-on-error: true
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- uses: ./
26+
id: current
27+
with:
28+
param1: 'false'
29+
30+
outputs:
31+
result: "${{ steps.current.outputs.result1 }}"
32+
33+
assert:
34+
runs-on: ubuntu-latest
35+
needs: [test]
36+
steps:
37+
- uses: nick-fields/assert-action@v1
38+
with:
39+
expected: 'false'
40+
actual: "${{ needs.test.outputs.result }}"
41+
42+
teardown:
43+
runs-on: ubuntu-latest
44+
needs: [assert]
45+
if: ${{ always() }}
46+
steps:
47+
- name: Tear down
48+
run: echo "Do Tear down"

.github/workflows/test-positive.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test example positive
2+
on:
3+
# # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
4+
# #
5+
# # Added pull_request to register workflow from the PR.
6+
# # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
7+
# pull_request: {}
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
setup:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Setup
15+
run: echo "Do setup"
16+
17+
test:
18+
runs-on: ubuntu-latest
19+
continue-on-error: true
20+
needs: [setup]
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- uses: ./
26+
id: current
27+
with:
28+
param1: 'true'
29+
30+
outputs:
31+
result: "${{ steps.current.outputs.result1 }}"
32+
33+
assert:
34+
runs-on: ubuntu-latest
35+
needs: [test]
36+
steps:
37+
- uses: nick-fields/assert-action@v1
38+
with:
39+
expected: 'true'
40+
actual: "${{ needs.test.outputs.result }}"
41+
42+
teardown:
43+
runs-on: ubuntu-latest
44+
needs: [assert]
45+
if: ${{ always() }}
46+
steps:
47+
- name: Tear down
48+
run: echo "Do Tear down"

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.build-harness
2+
build-harness

0 commit comments

Comments
 (0)