GitHub Action bug fixes (#11816)

* Update if statement w/r/t github.event.issue.pull_request conditional and update
cirrus-actions/rebase to 1.4.

* Fix running the PR comment workflow so it only runs if

github.event.pull_request.head.repo.full_name != github.repository

How neat!
This commit is contained in:
Joe Doss 2020-12-08 16:54:28 -06:00 committed by GitHub
parent 1c81978da2
commit 4504ac15ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -7,7 +7,7 @@ on:
jobs:
add_ci_label:
name: "Add CI label to PR"
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/ci') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
if: github.event.issue.pull_request && contains(github.event.comment.body, '/ci') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@ -18,7 +18,7 @@ jobs:
build_containers:
name: "Run Buildkite forem/build-containers pipeline"
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/ci') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
if: github.event.issue.pull_request && contains(github.event.comment.body, '/ci') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

View file

@ -6,7 +6,7 @@ on:
jobs:
pull_request_comment:
name: Comment on PR if coming from a forked repository
if: github.repository != 'forem/forem'
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Add comment to PR if coming from third-party fork

View file

@ -11,13 +11,14 @@ name: Automatic Rebase
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
if: github.event.issue.pull_request && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout the latest code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.3.1
uses: cirrus-actions/rebase@1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}