Skip to content

Commit 0bee2d5

Browse files
authored
git.io->cloudposse.tools update (#114)
1 parent 5641f58 commit 0bee2d5

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

.github/workflows/auto-readme.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: "auto-readme"
22
on:
3+
workflow_dispatch:
4+
35
schedule:
46
# Example of job definition:
57
# .---------------- minute (0 - 59)
@@ -15,21 +17,35 @@ on:
1517

1618
jobs:
1719
update:
18-
if: github.event_name == 'schedule'
20+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
1921
runs-on: ubuntu-latest
2022
steps:
2123
- uses: actions/checkout@v2
2224

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+
2335
- name: Update readme
2436
shell: bash
2537
id: update
2638
env:
2739
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
40+
DEF: "${{ steps.defaultBranch.outputs.defaultBranch }}"
2841
run: |
2942
make init
3043
make readme/build
3144
# Ignore changes if they are only whitespace
32-
git diff --ignore-all-space --ignore-blank-lines --quiet README.md && { git restore README.md; echo Ignoring whitespace-only changes in README; }
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
3349
3450
- name: Create Pull Request
3551
# This action will not create or change a pull request if there are no changes to make.
@@ -47,7 +63,7 @@ jobs:
4763
To have most recent changes of README.md and doc from origin templates
4864
4965
branch: auto-update/readme
50-
base: main
66+
base: ${{ steps.defaultBranch.outputs.defaultBranch }}
5167
delete-branch: true
5268
labels: |
5369
auto-update

Makefile

Lines changed: 1 addition & 1 deletion
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:

0 commit comments

Comments
 (0)