Skip to content

Commit d71bba5

Browse files
authored
Added shared branches (#32)
* Added shared workflows * Added shared branches
1 parent e8bc3d2 commit d71bba5

File tree

4 files changed

+384
-2
lines changed

4 files changed

+384
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ concurrency:
3939

4040
jobs:
4141
readme:
42-
uses: cloudposse/github-actions-workflows/.github/workflows/ci-readme.yml@main
42+
uses: cloudposse-github-actions/.github/.github/workflows/shared-readme.yml@main
4343
name: "readme"
4444
if: ${{ github.event_name == 'push' }}
4545
with:
@@ -108,7 +108,7 @@ jobs:
108108
needs: [ ci ]
109109
name: "release"
110110
if: ${{ always() && github.event_name == 'push' && needs.ci.result == 'success' }}
111-
uses: cloudposse/.github/.github/workflows/shared-auto-release.yml@main
111+
uses: cloudposse-github-actions/.github/.github/workflows/shared-auto-release.yml@main
112112
with:
113113
publish: ${{ inputs.publish }}
114114
secrets: inherit
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: "Shared auto release"
2+
on:
3+
workflow_call:
4+
inputs:
5+
prerelease:
6+
description: "Boolean indicating whether this release should be a prerelease"
7+
required: false
8+
default: false
9+
type: string
10+
publish:
11+
description: "Whether to publish a new release immediately"
12+
required: false
13+
default: false
14+
type: string
15+
runs-on:
16+
description: "Overrides job runs-on setting (json-encoded list)"
17+
type: string
18+
required: false
19+
default: '["ubuntu-latest"]'
20+
summary-enabled:
21+
description: Enable github action summary.
22+
required: false
23+
default: true
24+
type: boolean
25+
26+
outputs:
27+
id:
28+
description: The ID of the release that was created or updated.
29+
value: ${{ jobs.release.outputs.id }}
30+
name:
31+
description: The name of the release
32+
value: ${{ jobs.release.outputs.name }}
33+
tag_name:
34+
description: The name of the tag associated with the release.
35+
value: ${{ jobs.release.outputs.tag_name }}
36+
body:
37+
description: The body of the drafted release.
38+
value: ${{ jobs.release.outputs.body }}
39+
html_url:
40+
description: The URL users can navigate to in order to view the release
41+
value: ${{ jobs.release.outputs.html_url }}
42+
upload_url:
43+
description: The URL for uploading assets to the release, which could be used by GitHub Actions for additional uses, for example the @actions/upload-release-asset GitHub Action.
44+
value: ${{ jobs.release.outputs.upload_url }}
45+
major_version:
46+
description: The next major version number. For example, if the last tag or release was v1.2.3, the value would be v2.0.0.
47+
value: ${{ jobs.release.outputs.major_version }}
48+
minor_version:
49+
description: The next minor version number. For example, if the last tag or release was v1.2.3, the value would be v1.3.0.
50+
value: ${{ jobs.release.outputs.minor_version }}
51+
patch_version:
52+
description: The next patch version number. For example, if the last tag or release was v1.2.3, the value would be v1.2.4.
53+
value: ${{ jobs.release.outputs.patch_version }}
54+
resolved_version:
55+
description: The next resolved version number, based on GitHub labels.
56+
value: ${{ jobs.release.outputs.resolved_version }}
57+
exists:
58+
description: Tag exists so skip new release issue
59+
value: ${{ jobs.release.outputs.exists }}
60+
61+
permissions: {}
62+
63+
jobs:
64+
release:
65+
runs-on: ${{ fromJSON(inputs.runs-on) }}
66+
environment: release
67+
outputs:
68+
id: ${{ steps.drafter.outputs.id }}
69+
name: ${{ steps.drafter.outputs.name }}
70+
tag_name: ${{ steps.drafter.outputs.tag_name }}
71+
body: ${{ steps.drafter.outputs.body }}
72+
html_url: ${{ steps.drafter.outputs.html_url }}
73+
upload_url: ${{ steps.drafter.outputs.upload_url }}
74+
major_version: ${{ steps.drafter.outputs.major_version }}
75+
minor_version: ${{ steps.drafter.outputs.minor_version }}
76+
patch_version: ${{ steps.drafter.outputs.patch_version }}
77+
resolved_version: ${{ steps.drafter.outputs.resolved_version }}
78+
exists: ${{ steps.drafter.outputs.exists }}
79+
80+
steps:
81+
- uses: actions/create-github-app-token@v1
82+
id: github-app
83+
with:
84+
app-id: ${{ vars.BOT_GITHUB_APP_ID }}
85+
private-key: ${{ secrets.BOT_GITHUB_APP_PRIVATE_KEY }}
86+
87+
- name: Context
88+
id: context
89+
uses: cloudposse/[email protected]
90+
with:
91+
query: .${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
92+
config: |-
93+
true:
94+
config: auto-release.yml
95+
latest: true
96+
false:
97+
config: auto-release-hotfix.yml
98+
latest: false
99+
100+
# Drafts your next Release notes as Pull Requests are merged into "main"
101+
- uses: cloudposse/github-action-auto-release@fix-release-summary
102+
id: drafter
103+
with:
104+
token: ${{ steps.github-app.outputs.token }}
105+
publish: ${{ inputs.publish }}
106+
prerelease: ${{ inputs.prerelease }}
107+
latest: ${{ steps.context.outputs.latest }}
108+
summary-enabled: ${{ inputs.summary-enabled }}
109+
config-name: ${{ steps.context.outputs.config }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: |-
2+
CI - Readme
3+
4+
Validate README.yaml, README.md and suggest changes
5+
6+
### Usage
7+
```yaml
8+
name: Validate Readme
9+
on:
10+
workflow_call:
11+
12+
permissions:
13+
pull-requests: write
14+
id-token: write
15+
contents: read
16+
17+
jobs:
18+
ci-readme:
19+
uses: cloudposse/github-actions-workflows/.github/workflows/ci-readme.yml@main
20+
with:
21+
suggestions: true
22+
filter-mode: diff_context
23+
```
24+
on:
25+
workflow_call:
26+
inputs:
27+
ref:
28+
description: "Checkout ref"
29+
type: string
30+
required: false
31+
default: ${{ github.ref_name }}
32+
repository:
33+
description: "Checkout repository"
34+
type: string
35+
required: false
36+
default: ${{ github.repository }}
37+
runs-on:
38+
description: "Overrides job runs-on setting (json-encoded list)"
39+
type: string
40+
required: false
41+
default: '["ubuntu-latest"]'
42+
43+
jobs:
44+
validate:
45+
runs-on: ${{ fromJSON(inputs.runs-on) }}
46+
name: "Readme"
47+
environment: release
48+
steps:
49+
- uses: actions/create-github-app-token@v1
50+
id: github-app
51+
with:
52+
app-id: ${{ vars.BOT_GITHUB_APP_ID }}
53+
private-key: ${{ secrets.BOT_GITHUB_APP_PRIVATE_KEY }}
54+
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
with:
58+
ref: ${{ inputs.ref }}
59+
repository: ${{ inputs.repository }}
60+
fetch-depth: 0
61+
token: ${{ steps.github-app.outputs.token }}
62+
63+
- uses: cloudposse-github-actions/readme@v0
64+
with:
65+
token: ${{ steps.github-app.outputs.token }}
66+
readme_enabled: true
67+
banner_enabled: true
68+
validate_readme: true
69+
commit_method: 'commit'
70+
commit_push_options: '--force-with-lease'

0 commit comments

Comments
 (0)