Skip to content

Commit

Permalink
Merge branch 'readme_workflows' into Suzu
Browse files Browse the repository at this point in the history
  • Loading branch information
Gakuto1112 committed Nov 4, 2023
2 parents 307df4d + 58fd27a commit bbccdb0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 367 deletions.
193 changes: 0 additions & 193 deletions .github/readme_generator/package-lock.json

This file was deleted.

16 changes: 0 additions & 16 deletions .github/readme_generator/package.json

This file was deleted.

106 changes: 0 additions & 106 deletions .github/readme_generator/readme_generator.ts

This file was deleted.

54 changes: 3 additions & 51 deletions .github/workflows/generate_readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,12 @@ on:
- '.github/README_templates/**'
- '.github/README_images/**'
- '.github/workflows/generate_readme.yaml'
workflow_call:
inputs:
repository-name:
required: true
type: string
branch-name:
required: true
type: string

jobs:
generate-readme:
name: Generate README
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Output env variables (push)
if: ${{ github.event_name == 'push' }}
run: |
echo 'REPOSITORY_NAME=${{ github.repository }}' >> $GITHUB_ENV
echo 'BRANCH_NAME=${{ github.ref_name }}' >> $GITHUB_ENV
- name: Output env variables (workflow_call)
if: ${{ github.event_name == 'workflow_call' }}
run: |
echo 'REPOSITORY_NAME=${{ inputs.repository-name }}' >> $GITHUB_ENV
echo 'BRANCH_NAME=${{ inputs.branch-name }}' >> $GITHUB_ENV
- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ env.BRANCH_NAME }}
- name: Setup [email protected]
uses: actions/[email protected]
with:
node-version: 20.8.0
cache: npm
cache-dependency-path: './.github/readme_generator/package-lock.json'
- name: Install script dependencies
working-directory: ./.github/readme_generator
run: npm install
- name: Generate README
working-directory: ./.github/readme_generator
run: ./node_modules/.bin/ts-node ./readme_generator.ts ${{ env.REPOSITORY_NAME }} Gakuto1112/FiguraAvatarsReadmeTemplate main
- id: check_diff
name: Check diff
continue-on-error: true
run: |
git add -N --all
git diff --exit-code
- name: Commit and push
if: ${{ steps.check_diff.outcome == 'failure' }}
run: |
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git add --all
git commit -m '[GitHub Actions] ドキュメントの自動生成' -m '対象のコミット: ${{ github.sha }}'
git push origin
uses: Gakuto1112/FiguraAvatarsReadmeTemplate/.github/workflows/generate_my_figura_avatar_readme.yaml@main
with:
branch-name: ${{ github.ref_name }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
.luarc.json
avatar.code-workspace
.DS_Store
.github/readme_generator/node_modules

0 comments on commit bbccdb0

Please sign in to comment.