diff --git a/.github/workflows/lctt-article-checker.yml b/.github/workflows/lctt-article-checker.yml index 04a957114b..7330966b93 100644 --- a/.github/workflows/lctt-article-checker.yml +++ b/.github/workflows/lctt-article-checker.yml @@ -1,14 +1,8 @@ name: LCTT Article Checker on: - push: + pull_request: branches: [master] - # pull_request: - # branches: [ master ] - schedule: - - cron: "0 * * * *" - workflow_dispatch: - jobs: build: runs-on: ubuntu-latest @@ -18,10 +12,6 @@ jobs: TRAVIS_PULL_REQUEST: ${{ github.event.number }} ACTIONS_ALLOW_UNSECURE_COMMANDS: true steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - name: Set ENV variables run: | echo "::set-env name=TRAVIS_BRANCH::${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}" @@ -29,25 +19,9 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - ref: gh-pages - path: build - - name: Install JQ - run: sudo apt install jq -y + - name: "checkout master branch & return to pull request branch" + run: CURRENT=$(echo ${{github.ref}} | sed "s|refs/|refs/remotes/|") && git checkout master && git checkout $CURRENT + if: ${{ github.event_name == 'pull_request' }} - name: run check if: ${{ github.event_name == 'pull_request' }} run: sh ./scripts/check.sh; - - name: run badge - if: ${{ github.event_name != 'pull_request' }} - run: sh ./scripts/badge.sh; - - name: run status - if: ${{ github.event_name == 'schedule' }} - run: sh ./scripts/status.sh; - - uses: crazy-max/ghaction-github-pages@v2.2.0 - with: - keep_history: true - build_dir: ${{github.repository}}/build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}