Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Only run crons on base account #22

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
GITHUB_REF: ${{ github.ref }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
steps:
- name: Context
run: |
Expand All @@ -65,6 +66,8 @@ jobs:
# gitbub.repository - The owner and repository name. For example, Codertocat/Hello-World
# On forked repos, this will show <account_of_fork>/<repo>
echo "github.repository: $GITHUB_REPOSITORY"
# github.event_name - The event that triggered the workflow
echo "github.event_name: $GITHUB_EVENT_NAME"

# Generates a dynamic matrix of jobs to run tests on based on the inputs provided
genmatrix:
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,36 @@ on:

jobs:
ci:
name: CI
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
```

#### Running on a regular schedule

```yml
on:
# Run once per week
schedule:
- cron: '0 0 * * 1'

jobs:
ci:
name: CI
# Only run the cron on the account hosting this repository, not on the accounts of forks
# github.repository take the form of AccountName/repository-name
# Change '<account_name>/' to match the name of the account hosting this repository
if: (github.event_name == 'schedule' && startsWith(github.repository, '<account_name>/')) || (github.event_name != 'schedule')
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
```

#### Job configuration

Set config specific to your needs via "inputs" defined under the `with:` key. For instance, to disable PHP linting because your module does not yet have a `phpcs.xml.dist` file

```yml
jobs:
ci:
name: CI
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
with:
phplinting: false
Expand Down