Skip to content

Commit 5fa424b

Browse files
authored
Update migration readme script to remove includes (#179)
* Added readme script * Update shared-readme.yml * Update shared-readme.yml * Create shared-atmos-readme.yaml * Update shared-terraform-module.yml * Rename shared-atmos-readme.yaml to shared-atmos-readme.yml * Update shared-terraform-module.yml
1 parent ac8f85a commit 5fa424b

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI - Atmos Readme
2+
on:
3+
workflow_call:
4+
inputs:
5+
ref:
6+
description: "Checkout ref"
7+
type: string
8+
required: false
9+
default: ${{ github.ref_name }}
10+
repository:
11+
description: "Checkout repository"
12+
type: string
13+
required: false
14+
default: ${{ github.repository }}
15+
runs-on:
16+
description: "Overrides job runs-on setting (json-encoded list)"
17+
type: string
18+
required: false
19+
default: '["ubuntu-latest"]'
20+
21+
jobs:
22+
validate:
23+
runs-on: ${{ fromJSON(inputs.runs-on) }}
24+
name: "Readme"
25+
environment: release
26+
steps:
27+
- uses: actions/create-github-app-token@v1
28+
id: github-app
29+
with:
30+
app-id: ${{ vars.BOT_GITHUB_APP_ID }}
31+
private-key: ${{ secrets.BOT_GITHUB_APP_PRIVATE_KEY }}
32+
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
ref: ${{ inputs.ref }}
37+
repository: ${{ inputs.repository }}
38+
fetch-depth: 0
39+
token: ${{ steps.github-app.outputs.token }}
40+
41+
- uses: cloudposse-github-actions/readme@v1
42+
with:
43+
token: ${{ steps.github-app.outputs.token }}
44+
readme_enabled: true
45+
banner_enabled: true
46+
validate_readme: true
47+
commit_method: 'commit'
48+
commit_push_options: '--force-with-lease'

.github/workflows/shared-terraform-module.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ${{ inputs.runs-on }}
2525

2626
ci-readme:
27-
uses: cloudposse/.github/.github/workflows/shared-readme.yml@main
27+
uses: cloudposse/.github/.github/workflows/shared-atmos-readme.yml@main
2828
name: "Readme"
2929
if: ${{ github.event_name == 'push' }}
3030
with:

migrate/lib/readme.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ def migrate_readme(readme_yaml="README.yaml"):
8787
# Set 'contributors' section to an empty array, as we handle this now with an image
8888
data['contributors'] = []
8989

90+
if 'include' in data and isinstance(data['include'], list):
91+
# Remove deprecated includes
92+
include_to_remove = ['docs/terraform.md', 'docs/targets.md', 'docs/github-action.md']
93+
data['include'] = [
94+
file
95+
for file in data['include']
96+
if file not in include_to_remove
97+
]
98+
else:
99+
data['include'] = []
100+
90101
add_newlines_before_comments(data)
91102

92103
# Write back the updated YAML with multiple documents

migrate/migrations/20250523/script.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
title "Replace Makefile with atmos.yaml"
22

33
remove Makefile
4+
remove docs/terraform.md
5+
remove docs/targets.md
6+
migrate_readme
47
install atmos.yaml
58

69
# Merge the PR

0 commit comments

Comments
 (0)