Skip to content

Commit

Permalink
feat: レポジトリ名をmelos.yaml, pubspec.yamlに適用
Browse files Browse the repository at this point in the history
  • Loading branch information
mj-hd committed Jul 19, 2024
1 parent 4cd0c8f commit 8f952fa
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/actions/fill-project-name/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Fill project name"
description: "Fill project name of melos.yaml and pubspec.yaml with the repository name"

runs:
using: "composite"
steps:
- name: Get the repository name
id: repository
run: echo "name=$(basename -s .git `git remote get-url origin`)" >> $GITHUB_OUTPUT
shell: bash

- name: Fill the project name
uses: mikefarah/yq@f15500b20a1c991c8729870ba60a4dc3524b6a94 # v4.44.2
with:
cmd: |
yq -i '.name = "${{ steps.repository.outputs.name }}"' melos.yaml
yq -i '.name = "${{ steps.repository.outputs.name }}"' pubspec.yaml
- name: Debug
run: |
git diff
yq -r '.name' melos.yaml
yq -r '.name' pubspec.yaml
shell: bash
16 changes: 16 additions & 0 deletions .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Debug

on:
push:
branches:
- feature/apply-repository-name

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Fill project name
uses: ./.github/actions/fill-project-name

0 comments on commit 8f952fa

Please sign in to comment.