Skip to content

Commit

Permalink
Disable certain actions from running on forks (mattermost#23747)
Browse files Browse the repository at this point in the history
* Disable certain actions from running on forks

* Address some feedback

* Check for forks in build-docker job
  • Loading branch information
hmhealey authored Aug 8, 2023
1 parent e1c6ae7 commit 0e30d0a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
upload-s3:
name: cd/Upload artifacts to S3
runs-on: ubuntu-22.04
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
if: github.repository_owner == 'mattermost' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: cd/Configure AWS
uses: aws-actions/configure-aws-credentials@07c2f971bac433df982ccc261983ae443861db49 # v1-node16
Expand All @@ -36,7 +36,7 @@ jobs:
name: cd/Build and push docker image
needs: upload-s3
runs-on: ubuntu-22.04
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
if: github.repository_owner == 'mattermost' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: cd/Login to Docker Hub
uses: docker/login-action@3da7dc6e2b31f99ef2cb9fb4c50fb0971e0d0139 # v2.1.0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
permissions:
security-events: write # for github/codeql-action/autobuild to send a status report
name: Analyze
if: github.repository_owner == 'mattermost'
runs-on: ubuntu-latest

strategy:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-push-mirrored.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
jobs:
build-docker:
name: cd/Push mirrored docker images
if: github.repository_owner == 'mattermost'
runs-on: ubuntu-22.04
steps:
- name: Checkout mattermost project
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/esrupgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ on:
jobs:
esr-upgrade-5_37-7_8:
name: Run ESR upgrade script from 5.37 to 7.8
if: github.repository_owner == 'mattermost'
uses: ./.github/workflows/esrupgrade-common.yml
with:
db-dump-url: https://lt-public-data.s3.amazonaws.com/47K_537_mysql_collationfixed.sql.gz
initial-version: 5.37
final-version: 7.8
esr-upgrade-5_37-6_3:
name: Run ESR upgrade script from 5.37 to 6.3
if: github.repository_owner == 'mattermost'
uses: ./.github/workflows/esrupgrade-common.yml
with:
db-dump-url: https://lt-public-data.s3.amazonaws.com/47K_537_mysql_collationfixed.sql.gz
initial-version: 5.37
final-version: 6.3
esr-upgrade-6_3-7_8:
name: Run ESR upgrade script from 6.3 to 7.8
if: github.repository_owner == 'mattermost'
uses: ./.github/workflows/esrupgrade-common.yml
with:
db-dump-url: https://lt-public-data.s3.amazonaws.com/47K_63_mysql.sql.gz
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ permissions: read-all
jobs:
analysis:
name: Scorecards analysis
if: github.repository_owner == 'mattermost'
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
Expand Down

0 comments on commit 0e30d0a

Please sign in to comment.