From c13511a6ba371f51022df32154f187a2aa2426a8 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Sat, 2 Nov 2019 06:27:44 +0100 Subject: [PATCH] actions: Fix --- .github/workflows/pr.yml | 43 ++++++++++++++++++---- .github/workflows/{build.yml => push.yml} | 44 ++++------------------- .github/workflows/scraper.yml | 2 +- 3 files changed, 44 insertions(+), 45 deletions(-) rename .github/workflows/{build.yml => push.yml} (56%) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9a5991ea50..cd8a8df639 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,11 +1,19 @@ -name: OpenOSRS - CI (push) +name: OpenOSRS - CI (PR) -on: - push: - branches: - - master +on: pull_request jobs: + pr-lint: + name: PR title + runs-on: ubuntu-latest + + steps: + - name: PR title lint + if: github.event_name == 'pull_request' + uses: seferov/pr-lint-action@master + with: + title-regex: '^([\w-/]+): \w+' + build: runs-on: ubuntu-latest name: Build @@ -55,4 +63,27 @@ jobs: - name: Assembling run: ./gradlew assemble --console=plain - name: Checking code conventions - run: ./gradlew checkstyleMain --console=plain \ No newline at end of file + run: ./gradlew checkstyleMain --console=plain + + approve: + name: Approve + needs: [build, test, checkstyle] + runs-on: ubuntu-latest + + steps: + - name: Approve pull request + if: github.event_name == 'pull_request' && github.actor == 'OpenOSRS' + uses: hmarr/auto-approve-action@v2.0.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + merge: + name: Merge + needs: approve + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: maxkomarychev/merge-pal-action@v0.1.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/push.yml similarity index 56% rename from .github/workflows/build.yml rename to .github/workflows/push.yml index 0c57b34b2c..9a5991ea50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/push.yml @@ -1,19 +1,11 @@ -name: OpenOSRS - CI (PR) +name: OpenOSRS - CI (push) -on: pull_request +on: + push: + branches: + - master jobs: - pr-lint: - name: PR title - runs-on: ubuntu-latest - - steps: - - name: PR title lint - if: github.event_name == 'pull_request' - uses: seferov/pr-lint-action@master - with: - title-regex: '^([\w-/]+): \w+' - build: runs-on: ubuntu-latest name: Build @@ -63,28 +55,4 @@ jobs: - name: Assembling run: ./gradlew assemble --console=plain - name: Checking code conventions - run: ./gradlew checkstyleMain --console=plain - - approve: - name: Approve - needs: [build, test, checkstyle] - runs-on: ubuntu-latest - - steps: - - name: Approve pull request - if: github.event_name == 'pull_request' && github.actor == 'OpenOSRS' - uses: hmarr/auto-approve-action@v2.0.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - automerge: - name: Automerge - needs: approve - runs-on: ubuntu-latest - - steps: - - name: automerge - uses: pascalgn/automerge-action@f84dd310ea4a19890c70a4ff11ab282a872fb94b - env: - AUTOMERGE: "automated pull request" - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file + run: ./gradlew checkstyleMain --console=plain \ No newline at end of file diff --git a/.github/workflows/scraper.yml b/.github/workflows/scraper.yml index 591bbd73f6..762e79bb67 100644 --- a/.github/workflows/scraper.yml +++ b/.github/workflows/scraper.yml @@ -25,7 +25,7 @@ jobs: - name: Building scraper run: ./gradlew :wiki-scraper:build --console=plain - name: Downloading jagex cache - run: ./gradlew :cache-client:update --console=plain + run: ./gradlew :cache-client:download --console=plain - name: Scraping NPC stats run: ./gradlew :wiki-scraper:npcStatsScrape --console=plain - name: Create NPC stats Pull Request