Skip to content

Commit 4eee077

Browse files
authored
git.io->cloudposse.tools update (#55)
1 parent 8d30d01 commit 4eee077

11 files changed

+113
-21
lines changed

.github/CODEOWNERS

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
# Cloud Posse must review any changes to standard context definition,
1717
# but some changes can be rubber-stamped.
18-
**/*.tf @cloudposse/engineering @cloudposse/approvers
19-
README.yaml @cloudposse/engineering @cloudposse/approvers
18+
**/*.tf @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
19+
README.yaml @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
2020
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
2121
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
2222

.github/auto-release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ version-resolver:
1717
- 'bugfix'
1818
- 'bug'
1919
- 'hotfix'
20+
- 'no-release'
2021
default: 'minor'
2122

2223
categories:
@@ -46,7 +47,7 @@ template: |
4647
4748
replacers:
4849
# Remove irrelevant information from Renovate bot
49-
- search: '/---\s+^#.*Renovate configuration(?:.|\n)*?This PR has been generated .*/gm'
50+
- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
5051
replace: ''
5152
# Remove Renovate bot banner image
5253
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'

.github/mergify.yml

+7
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,10 @@ pull_request_rules:
5656
changes_requested: true
5757
approved: true
5858
message: "This Pull Request has been updated, so we're dismissing all reviews."
59+
60+
- name: "close Pull Requests without files changed"
61+
conditions:
62+
- "#files=0"
63+
actions:
64+
close:
65+
message: "This pull request has been automatically closed by Mergify because there are no longer any changes."

.github/workflows/auto-context.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
3636
- name: Create Pull Request
3737
if: steps.update.outputs.create_pull_request == 'true'
38-
uses: cloudposse/actions/github/create-pull-request@0.22.0
38+
uses: cloudposse/actions/github/create-pull-request@0.30.0
3939
with:
4040
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
4141
committer: 'cloudpossebot <[email protected]>'

.github/workflows/auto-format.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
auto-format:
88
runs-on: ubuntu-latest
9-
container: cloudposse/build-harness:slim-latest
9+
container: cloudposse/build-harness:latest
1010
steps:
1111
# Checkout the pull request branch
1212
# "An action in a workflow run can’t trigger a new workflow run. For example, if an action pushes code using
@@ -29,6 +29,8 @@ jobs:
2929
- name: Auto Format
3030
if: github.event.pull_request.state == 'open'
3131
shell: bash
32+
env:
33+
GITHUB_TOKEN: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
3234
run: make BUILD_HARNESS_PATH=/build-harness PACKAGES_PREFER_HOST=true -f /build-harness/templates/Makefile.build-harness pr/auto-format/host
3335

3436
# Commit changes (if any) to the PR branch
@@ -60,7 +62,7 @@ jobs:
6062
fi
6163
6264
- name: Auto Test
63-
uses: cloudposse/actions/github/repository-dispatch@0.22.0
65+
uses: cloudposse/actions/github/repository-dispatch@0.30.0
6466
# match users by ID because logins (user names) are inconsistent,
6567
# for example in the REST API Renovate Bot is `renovate[bot]` but
6668
# in GraphQL it is just `renovate`, plus there is a non-bot

.github/workflows/auto-readme.yml

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

.github/workflows/auto-release.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ name: auto-release
33
on:
44
push:
55
branches:
6-
- master
6+
- main
7+
- master
8+
- production
79

810
jobs:
911
publish:
1012
runs-on: ubuntu-latest
1113
steps:
12-
# Drafts your next Release notes as Pull Requests are merged into "master"
13-
- uses: release-drafter/release-drafter@v5
14-
with:
15-
publish: true
16-
prerelease: false
17-
config-name: auto-release.yml
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
14+
# Get PR from merged commit to master
15+
- uses: actions-ecosystem/action-get-merged-pull-request@v1
16+
id: get-merged-pull-request
17+
with:
18+
github_token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
19+
# Drafts your next Release notes as Pull Requests are merged into "main"
20+
- uses: release-drafter/release-drafter@v5
21+
with:
22+
publish: ${{ !contains(steps.get-merged-pull-request.outputs.labels, 'no-release') }}
23+
prerelease: false
24+
config-name: auto-release.yml
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}

.github/workflows/chatops.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: "Handle common commands"
12-
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
12+
uses: cloudposse/actions/github/slash-command-dispatch@0.30.0
1313
with:
1414
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
1515
reaction-token: ${{ secrets.GITHUB_TOKEN }}
@@ -24,7 +24,7 @@ jobs:
2424
- name: "Checkout commit"
2525
uses: actions/checkout@v2
2626
- name: "Run tests"
27-
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
27+
uses: cloudposse/actions/github/slash-command-dispatch@0.30.0
2828
with:
2929
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
3030
reaction-token: ${{ secrets.GITHUB_TOKEN }}
+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Validate Codeowners
22
on:
3+
workflow_dispatch:
4+
35
pull_request:
46

57
jobs:
@@ -8,18 +10,20 @@ jobs:
810
steps:
911
- name: "Checkout source code at current commit"
1012
uses: actions/checkout@v2
11-
- uses: mszostok/codeowners-validator@v0.5.0
13+
- uses: mszostok/codeowners-validator@v0.7.1
1214
if: github.event.pull_request.head.repo.full_name == github.repository
1315
name: "Full check of CODEOWNERS"
1416
with:
1517
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
1618
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
1719
# checks: "files,syntax,owners,duppatterns"
1820
checks: "syntax,owners,duppatterns"
21+
owner_checker_allow_unowned_patterns: "false"
1922
# GitHub access token is required only if the `owners` check is enabled
2023
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
21-
- uses: mszostok/codeowners-validator@v0.5.0
24+
- uses: mszostok/codeowners-validator@v0.7.1
2225
if: github.event.pull_request.head.repo.full_name != github.repository
2326
name: "Syntax check of CODEOWNERS"
2427
with:
2528
checks: "syntax,duppatterns"
29+
owner_checker_allow_unowned_patterns: "false"

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SHELL := /bin/bash
33
# List of targets the `readme` target should call before generating the readme
44
export README_DEPS ?= docs/targets.md docs/terraform.md
55

6-
-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)
6+
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)
77

88
## Lint terraform code
99
lint:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
325325

326326
## Copyright
327327

328-
Copyright © 2017-2021 [Cloud Posse, LLC](https://cpco.io/copyright)
328+
Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright)
329329

330330

331331

0 commit comments

Comments
 (0)