Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Allow access to secrets for external contributors (#318)
Browse files Browse the repository at this point in the history
* Update check-test-release.yml

* Apply suggestions from code review

Co-authored-by: Helio Machado <0x2b3bfa0+git@googlemail.com>
  • Loading branch information
aguschin and 0x2b3bfa0 committed Jun 29, 2022
1 parent 04e2be3 commit 958d61e
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/check-test-release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
name: Check, test and release
on:
push:
pull_request:
pull_request_target:
schedule:
- cron: '0 7 * * 1' # M H d m w (Mondays at 7:00)

env:
MLEM_TESTS: "true"

jobs:
authorize:
if: |
startsWith(github.ref, 'refs/tags') ||
github.event_name == 'pull_request_target' ||
github.event_name == 'schedule' ||
github.repository_owner != 'iterative'
environment:
${{ (github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository) &&
'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: echo ✓
check:
if: startsWith(github.ref, 'refs/tags') || github.event_name == 'pull_request' || github.event_name == 'schedule' || github.repository_owner != 'iterative'
needs: authorize
name: Check
runs-on: ubuntu-latest
steps:
Expand All @@ -21,6 +34,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v2
- name: set PYSHA
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
Expand All @@ -31,7 +45,7 @@ jobs:
- run: pip install -U pre-commit tox
- run: SKIP=pylint pre-commit run -a --show-diff-on-failure
test:
if: startsWith(github.ref, 'refs/tags') || github.event_name == 'pull_request' || github.event_name == 'schedule' || github.repository_owner != 'iterative'
needs: authorize
name: Test ${{ matrix.os }} with py${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -47,6 +61,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
Expand Down Expand Up @@ -103,6 +118,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v2
- id: dist
uses: casperdcl/deploy-pypi@v2
Expand Down

0 comments on commit 958d61e

Please sign in to comment.