Skip to content

Commit d482e16

Browse files
author
Kośka Piotr
committed
Update CW02 rozwiazania
1 parent 405daf4 commit d482e16

3 files changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 02 - Workflow Events
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
echo:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Show the trigger
11+
run: |
12+
echo "Event name: ${{ github.event_name }}"
13+
14+
# Commit & push:
15+
# ```bash
16+
# git add .github/workflows/02-workflow-events.yaml
17+
# git commit -m "Exercise 02: basic workflow with push trigger"
18+
# git push
19+
# ```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 02 - Workflow Events v2
2+
# Wersja rozszerzona — push, pull_request, schedule, workflow_dispatch
3+
4+
on:
5+
#push:
6+
pull_request:
7+
schedule:
8+
- cron: "0 9 * * *" # codziennie o 09:00 UTC
9+
workflow_dispatch:
10+
11+
jobs:
12+
echo:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Show the trigger
16+
run: |
17+
echo "Event name: ${{ github.event_name }}"
18+
19+
# Commit & push:
20+
# ```bash
21+
# git add .github/workflows/02-workflow-events.yaml
22+
# git commit -m "Exercise 02: add PR, schedule and manual triggers"
23+
# git push
24+
# ```
25+
26+
# Jak przetestować:
27+
# - pull_request: utwórz nowy branch, zmień coś, otwórz PR → workflow ruszy na pull_request.
28+
# - schedule: poczekaj na najbliższe okno crona (albo ustaw bliższy czas, np. co godzinę: 0 * * * *).
29+
# - workflow_dispatch (z UI):
30+
# Actions → wybierz 02 - Workflow Events → Run workflow.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 02 - Workflow Events v3
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
echo:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Show the trigger
11+
run: |
12+
echo "Event name: ${{ github.event_name }}"
13+
14+
# Commit & push:
15+
# ```bash
16+
# git add .github/workflows/02-workflow-events.yaml
17+
# git commit -m "Exercise 02: keep only workflow_dispatch trigger"
18+
# git push
19+
# ```

0 commit comments

Comments
 (0)