# Single and Multiple Events

<figure><img src="/files/yylExbcmzFMapAL5q05K" alt=""><figcaption></figcaption></figure>

GitHub Actions'ta, iş akışlarınızı (workflow) belirli olaylara (event) göre tetikleyebilirsiniz. Bu olaylar, kod push'ları, pull request'ler veya zamanlanmış görevler gibi çeşitli etkinlikler olabilir. İş akışlarınızı tek bir olayla veya birden fazla olayla tetiklemek mümkündür.

#### Single Event,

```yaml
name: CI on Push

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run a one-line script
        run: echo "Hello, world!"
```

**Ne Yapar?**

* Bu workflow, sadece **main** branch'ine **push** olayı gerçekleştiğinde çalışır.
* "Hello, world!" mesajını terminale yazdırır.

#### Multiple Event,

```yaml
name: CI on Multiple Events

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
  release:
    types:
      - published
      - created

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        # ....

```

**Ne Yapar?**

* Bu workflow şu olaylarda çalışır:
  1. **Push:** main branch’ine bir değişiklik gönderildiğinde.
  2. **Pull Request:** main branch için bir pull request açıldığında.
  3. **Release:** Yeni bir release oluşturulduğunda ya da yayımlandığında (**published** ve **created** olayları).
* Yukarıdaki herhangi bir olay tetiklendiğinde `build-and-test` job'u çalışır.

#### **Multiple Event**:

* Eğer bir workflow içinde birden fazla olay (event) tanımlarsanız, bunlardan herhangi birinin gerçekleşmesi workflow'u tetiklemek için yeterlidir.
* Yani **push**, **pull\_request**, veya **release** olaylarından biri gerçekleştiğinde workflow çalıştırılır.

**Birden Fazla Olayın Aynı Anda Meydana Gelmesi:**

* Eğer birden fazla olay aynı anda meydana gelirse, her biri için ayrı bir **workflow run** oluşturulur.
* Örneğin:
  * Aynı anda hem bir **push** işlemi yapılırsa hem de bir **pull request** açılırsa, workflow iki kez çalıştırılır ve iki ayrı run oluşturulur.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://note.onurbolatoglu.com/github-actions/single-and-multiple-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
