Skip to content

Commit

Permalink
add error
Browse files Browse the repository at this point in the history
  • Loading branch information
withanage committed Jun 11, 2024
1 parent d9090a1 commit f13c516
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,37 @@ jobs:
steps:
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: "install Dependencies"
- name: Install Dependencies
run: |
sudo apt-get update -qq
sudo apt-get install libxml2-utils
npm install -g pkp-plugin-cli
shell: bash

- name: Clone pkp plugin gallery
run: |
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
git clone -b main https://github.com/pkp/plugin-gallery --depth 50
shell: bash

- name: Install for push
if: ${{ github.event_name == 'push'}}
run: |
git clone -b ${{ github.head_ref || github.ref_name }} https://github.com/${{ github.repository}} ~/${{ github.event.repository.name }} --depth 50
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: Install for pull_request
if: ${{github.event_name == 'pull_request'}}
run: |
git clone -b ${{ github.event.pull_request.head.ref}} ${{ github.event.pull_request.head.repo.html_url}} ~/${{ github.event.pull_request.head.repo.name }} --depth 50
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
git remote add user_repo https://github.com/${{ github.event.pull_request.head.repo.name }}
git fetch user_repo ${{ github.event.pull_request.head.ref}} ${{ github.event.pull_request.head.repo.html_url}}
git checkout -b user_repo/${{ github.event.pull_request.head.ref}} ${{ github.event.pull_request.head.repo.html_url}}
shell: bash

- name: "Run plugin validation"
Expand All @@ -49,20 +61,17 @@ jobs:
pkp-plugin validate-all-releases --input ./plugins.xml
shell: bash

- name: For pull request
- name: For pull request validate-new-release
if: ${{ github.event_name == 'pull_request'}}
run: |
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
pwd
pkp-plugin validate-new-release
shell: bash

- name: For push
- name: For push generate-site
if: ${{ github.event_name == 'push' && github.head_ref == '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
shell: bash
- name: Setup tmate session by failure
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

0 comments on commit f13c516

Please sign in to comment.