From 917f5098a0874d8f16a843e6c41f0fe59881afc5 Mon Sep 17 00:00:00 2001 From: Kaitlin Newson Date: Fri, 15 Nov 2024 09:58:46 -0400 Subject: [PATCH] Fix github ref in main.yml --- .github/workflows/main.yml | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fc0926d6..78e21f0b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ on: env: XML_SCHEMA: "plugins.xsd" -name: plugin-gallery +name: plugin-gallery jobs: plugin-gallery: runs-on: ubuntu-latest @@ -31,48 +31,48 @@ jobs: shell: bash - name: Clone user plugin-gallery for push - if: ${{ github.event_name == 'push'}} + if: ${{ github.event_name == 'push' }} run: | - cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }} - git remote add user_repo https://github.com/${{ github.repository}} + cd ~/${{ github.event.pull_request.head.repo.name || github.event.repository.name }} + git remote add user_repo https://github.com/${{ github.repository }} git fetch user_repo ${{ github.head_ref || github.ref_name }} git checkout -b user_repo/${{ github.head_ref || github.ref_name }} shell: bash - name: lone user plugin-gallery for pull request - if: ${{github.event_name == 'pull_request'}} + if: ${{ github.event_name == 'pull_request' }} run: | - cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }} - git remote add user_repo ${{ github.event.pull_request.head.repo.html_url}} - git fetch user_repo ${{ github.event.pull_request.head.ref}} - git checkout user_repo/${{ github.event.pull_request.head.ref}} + cd ~/${{ github.event.pull_request.head.repo.name || github.event.repository.name }} + git remote add user_repo ${{ github.event.pull_request.head.repo.html_url }} + git fetch user_repo ${{ github.event.pull_request.head.ref }} + git checkout user_repo/${{ github.event.pull_request.head.ref }} shell: bash - - name: Validate against plugins.xd schema + - name: Validate against plugins.xsd schema run: | - cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }} + cd ~/${{ github.event.pull_request.head.repo.name || github.event.repository.name }} xmllint --schema ./plugins.xsd ./plugins.xml --noout shell: bash - - name: Validate all releases - if: ${{ github.event_name == 'push' && github.head_ref == 'main'}} + - name: Validate all releases + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} run: | - cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }} + cd ~/${{ github.event.pull_request.head.repo.name || github.event.repository.name }} pkp-plugin validate-all-releases --input ./plugins.xml shell: bash - name: Validate new release - if: ${{ github.event_name == 'pull_request'}} + if: ${{ github.event_name == 'pull_request'}} run: | - cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }} + cd ~/${{ github.event.pull_request.head.repo.name || github.event.repository.name }} git remote -v git branch pkp-plugin validate-new-release shell: bash - - name: Generate site - if: ${{ github.event_name == 'push' && github.head_ref == 'main'}} + - name: Generate site + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} run: | - cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }} - GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}} pkp-plugin generate-site ./plugins.xml + cd ~/${{ github.event.pull_request.head.repo.name || github.event.repository.name }} + GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} pkp-plugin generate-site ./plugins.xml shell: bash