chore: use quoted paths (#502) #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: resolve_readmes | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/resolve_readmes.yaml | |
- bricks/**/brick/README.md | |
- melos.yaml | |
- README.md | |
- tools/readmes_resolver/** | |
jobs: | |
resolve-root-readme: | |
name: Resolve root README | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: 3.27.1 | |
- name: Install melos | |
run: dart pub global activate melos 6.2.0 | |
- name: Initialize READMEs resolver | |
run: melos bs --scope=readmes_resolver | |
- name: Resolve root README file | |
run: melos run docs.root | |
- name: Create PR | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
base: main | |
add-paths: | | |
./README.md | |
branch: docs/update-root-readme | |
commit-message: 'docs: update root README' | |
title: 'docs: update root README' | |
body: Update root README. | |
delete-branch: true | |
labels: | | |
bot | |
docs | |
author: Altoke Bot <[email protected]> | |
committer: Altoke Bot <[email protected]> | |
assignees: mrverdant13 | |
reviewers: mrverdant13 | |
identify-brick-scopes: | |
name: Identify brick scopes | |
runs-on: ubuntu-latest | |
outputs: | |
scopes: ${{ steps.identify-brick-scopes.outputs.scopes }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: 3.27.1 | |
- name: Install melos | |
run: dart pub global activate melos 6.2.0 | |
- name: Initialize brick scopes | |
run: melos bs --category=scopes | |
- name: Identify brick scopes | |
id: identify-brick-scopes | |
run: echo "scopes=$(melos list --category=scopes --json | tr -d '\n')" >> "$GITHUB_OUTPUT" | |
- name: List identified scopes | |
run: echo "${{ join(steps.identify-brick-scopes.outputs.scopes.*.name, ', ') }}" | |
resolve-brick-readme: | |
name: Resolve brick README | |
runs-on: ubuntu-latest | |
needs: identify-brick-scopes | |
strategy: | |
matrix: | |
scope: ${{fromJson(needs.identify-brick-scopes.outputs.scopes)}} | |
steps: | |
- name: Build brick scope name | |
id: build-brick-scope-name | |
run: echo "brick-scope-name=$(echo ${{ matrix.scope.name }})" >> "$GITHUB_OUTPUT" | |
- name: Build brick name | |
id: build-brick-name | |
run: echo "brick-name=$(echo ${{ steps.build-brick-scope-name.outputs.brick-scope-name }} | sed 's/_brick_scope//g')" >> "$GITHUB_OUTPUT" | |
- name: Build brick tag name | |
id: build-brick-tag-name | |
run: echo "brick-tag-name=$(echo ${{ steps.build-brick-name.outputs.brick-name }} | sed 's/_/-/g')" >> "$GITHUB_OUTPUT" | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: 3.27.1 | |
- name: Install melos | |
run: dart pub global activate melos 6.2.0 | |
- name: Initialize READMEs resolver | |
run: melos bs --scope=readmes_resolver | |
- name: Set relevant packages | |
run: echo "MELOS_PACKAGES=${{ steps.build-brick-scope-name.outputs.brick-scope-name }}" >> "$GITHUB_ENV" | |
- name: Generate template | |
run: melos run docs.brick | |
- name: Create PR | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
base: main | |
add-paths: | | |
./bricks/${{ steps.build-brick-name.outputs.brick-name }}/brick/README.md | |
branch: docs/${{ steps.build-brick-tag-name.outputs.brick-tag-name }}/update-readme | |
commit-message: 'docs(b-${{ steps.build-brick-tag-name.outputs.brick-tag-name }}): update README' | |
title: 'docs(b-${{ steps.build-brick-tag-name.outputs.brick-tag-name }}): update README' | |
body: Update README. | |
delete-branch: true | |
labels: | | |
bot | |
docs | |
b:${{ steps.build-brick-tag-name.outputs.brick-tag-name }} | |
author: Altoke Bot <[email protected]> | |
committer: Altoke Bot <[email protected]> | |
assignees: mrverdant13 | |
reviewers: mrverdant13 | |