main #5

Open
wwitchq wants to merge 2 commits from wwitchq/actions-laba-1-v:main into main
3 changed files with 37 additions and 42 deletions

View File

@@ -8,35 +8,11 @@ on:
jobs:
second-job:
runs-on: docker # docker, sirius или golang
runs-on: golang
steps:
- run: |
if [ ${{ gitea.actor }} == 'alex' ]; then
echo "Hello, ${{ gitea.actor }}"
if [ ${{ gitea.actor }} == 'wwitchq' ]; then
echo "Hello, ${{ gitea.actor }}"
else
echo "Hello, student"
echo "Hello, Violetta"
fi
# Клонируем репозиторий для Runnera
- name: Checkout rpository
uses: actions/checkout@v6
# Выводим текстовое сообщение
- name: Echo test
run: echo "Hello, ${{ gitea.actor }}"
# Выводим путь к репозиторию
- name: Repo name
run: echo "Hello, ${{ gitea.repository }}"
# Выводим переменные окружения
- name: Show environment
run: env
# Выводим контекст Gitea в формате JSON
- name: Show Gitea context
run: echo "${{ toJson(gitea) }}"
# Выводим контекст Gihub в формате JSON
- name: Show Gitea context
run: echo "${{ toJson(github) }}"

View File

@@ -1,25 +1,28 @@
name: "Example condition"
run-name: "Check Job condition"
run-name: "deploy all condition"
on:
issues:
types:
- closed
- labeled
- opened
- unlabeled
push:
paths:
- test.txt
- services.txt
branches:
- main
issue_comment:
types:
- created
jobs:
check-condition:
runs-on: sirius # docker, sirius или golang
# if: contains(github.event.issue.labels.*.name, 'bug')
runs-on: golang
if: contains(github.event.issue.labels.*.name, 'bug')
steps:
# Поздароваемся
- name: Hello
if: github.event.issue.user.login == 'alex'
run: echo "Hello, Alex!!!"
# Выводим текстовое сообщение
- name: Echo test
run: echo "Этот шаг выполнится только при выполнении условия above"
- name: Echo test
if: contains(github.event.issue.labels.*.name, 'bug')
run: echo "${{ toJson(github.event.issue) }}"

View File

@@ -0,0 +1,16 @@
name: "Example condition"
run-name: "condition 2"
on:
issues:
types:
- labeled
- opened
- unlabeled
jobs:
check-condition:
runs-on: golang
if: contains(github.event.issue.labels.*.name, 'bug')
steps:
- name: Echo test
if: contains(github.event.issue.labels.*.name, 'bug')
run: echo "${{ toJson(github.event.issue) }}"