88591


59行目にエラーがあると吐き出されます。  
一階構文を確認したのですが、yamlは初めてなので、初心的な間違いをしてるかもしれません。  
親切に教えてくださると幸甚です。

[code]

    # This is a basic workflow to help you get started with Actions
    
    name: Replace Tag & Push
    
    # Controls when the workflow will run
    on:
      # Triggers the workflow on push or pull request events but only for the main branch
      push:
        branches: [ main ]
      pull_request:
        branches: [ main ]
    
      # Allows you to run this workflow manually from the Actions tab
      workflow_dispatch:
    
    # A workflow run is made up of one or more jobs that can run sequentially or in parallel
    jobs:
      # This workflow contains a single job called "build"
      replace:
        # The type of runner that the job will run on
        runs-on: ubuntu-latest
    
        # Steps represent a sequence of tasks that will be executed as part of the job
        steps:
          # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
          - uses: actions/checkout@v3
          - name: Status
            run: |
              ls -XlR
              find -type f -print0 | sort -z | xargs -0 sha1sum > hash.txt
          - name: Delete all mdx files
            run: |
              rm -fv ./pages/*.mdx
          - name: Replace slug
            run: |
              mkdir arrange
              cp -fvr ./documents/* ./arrange/
          - name: Copy all mdx files
            run: |
              cp -fpvr ./arrange/* ./pages/
          - name: Delete
            run: rm -rf ./arrange
          - name: Hash Check
            run: |
              CURRENT_CACHE=`cat ./hash.txt`
              rm -f ./hash.txt
              NOW_CACHE=`find -type f -print0 | sort -z | xargs -0 sha1sum`
              if [ CURRENT_CACHE != NOW_CACHE ]; then
                echo "::set-output name=skip_ci::false"
              else
                echo "::set-output name=skip_ci::true"
              fi
    
      pushjob:
        runs-on: ubuntu-latest
        needs: replace
        if: ${{ needs.replace.outputs.skip_ci != 'true' }}
        steps:
          - uses: actions/checkout@v3
          - name: Replace
            - run: |
              git config --global user.name "github-actions[bot]"
              git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
              git pull
              git add -A
              git commit -m "Push replaced pages"
              git push
    
[/code]

GitHubのメッセージ

[code]

    Invalid workflow file
    You have an error in your yaml syntax on line 59
    
[/code]


CC BY-SA 4.0
2022-04-30T23:54:39.997
88589
2022-05-01T01:57:05.793
2022-05-01T00:04:29.433
50850
50850
question
github github-actions yaml
Github Actionsのワークフロー構文がSyntax Errorになる


エラーメッセージの言っている行数とはずれていますが、ここは↓

[code]

          - name: Replace
            - run: |
              git config --global user.name "github-actions[bot]"
    
[/code]

`name` と `run` が同じ階層に居るべきなので、こうです。

[code]

          - name: Replace
            run: |
              git config --global user.name "github-actions[bot]"
    
[/code]

<https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-
github-actions#jobsjob_idstepsrun>


CC BY-SA 4.0
2022-05-01T01:57:05.793
88591
2022-05-01T01:57:05.793
19110
88589
answer