diff --git a/.gitea/workflows/example-condition.yaml b/.gitea/workflows/example-condition.yaml index 0e321b3..db33f3a 100644 --- a/.gitea/workflows/example-condition.yaml +++ b/.gitea/workflows/example-condition.yaml @@ -1,5 +1,5 @@ name: "Example condition" -run-name: "multple condition" +run-name: "deply condition" on: issues: @@ -12,16 +12,52 @@ on: - services.txt branches: - main + # ПРОСТОЕ ДОПОЛНЕНИЕ: при комментарии в issue + issue_comment: + types: [created] - - jobs: check-condition: - runs-on: sirius # docker, sirius или golang - if: contains(github.event.issue.labels.*.name, 'bug') + runs-on: sirius + # ПРОСТОЕ УСЛОВИЕ: только если комментарий содержит "deploy" + if: | + github.event_name != 'issue_comment' || + contains(github.event.comment.body, 'deploy') steps: - # Выводим текстовое сообщение - - name: Echo test - if: contains(github.event.issue.labels.*.name, 'bug') - run: echo "${{ toJson(github.event.issue) }}" + - name: Process comment + run: | + if [ "${{ github.event_name }}" = "issue_comment" ]; then + echo "Deploy command detected in comment!" + else + echo "Regular event: ${{ github.event_name }}" + fi + + +# name: "Example condition" +# run-name: "multple condition" + +# on: +# issues: +# types: +# - closed +# - labeled +# push: +# paths: +# - test.txt +# - services.txt +# branches: +# - main + + + +# jobs: +# check-condition: +# runs-on: sirius # docker, sirius или 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) }}" diff --git a/services.txt b/services.txt index f9becf6..34cdfc0 100644 --- a/services.txt +++ b/services.txt @@ -1,3 +1,5 @@ micro like -cool \ No newline at end of file +cool + +djgdhhudhuehjkeshjd \ No newline at end of file diff --git a/test.txt b/test.txt index 07f523e..d57ddec 100644 --- a/test.txt +++ b/test.txt @@ -1 +1,2 @@ -hello, myself \ No newline at end of file +hello, myself +dejdjkdwkaj \ No newline at end of file