From 4126e7d9c40acce32e89e6ad7d8a4a1735b56a54 Mon Sep 17 00:00:00 2001 From: safinsaf Date: Wed, 13 Apr 2022 13:35:20 +0300 Subject: [PATCH] Try environments Signed-off-by: safinsaf --- .github/build-iroha1-fork.src.yml | 29 +++++++------------------ .github/workflows/build-iroha1-fork.yml | 20 +++++++---------- 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/.github/build-iroha1-fork.src.yml b/.github/build-iroha1-fork.src.yml index bb565a3500b..9c7f85efb88 100644 --- a/.github/build-iroha1-fork.src.yml +++ b/.github/build-iroha1-fork.src.yml @@ -15,13 +15,11 @@ permissions: ## This workflow is created for pull requests from forks only and has less permissions than build-iroha1 workflow on: - #pull_request_target: - # branches: [ main, support/1.*, edge, develop, feature/DOPS-1651/enable-fork-build ] ## target branches - - - issue_comment: - types: [created] + pull_request_target: branches: [ main, support/1.*, edge, develop, feature/DOPS-1651/enable-fork-build ] + paths-ignore: + - '**.md' + - '**.rst' env: @@ -29,17 +27,13 @@ env: jobs: - - ## This step allows to skip the workflow completely for pull_requests from the same repo ## Also it checks that that .github folder and Dockerfiles are not changed check_if_pull_request_comes_from_fork: - runs-on: ubuntu-20.04 #ubuntu-latest - name: Pull requests from forks should use other workflow - if: ${{ github.event.issue.comment.body == "Launch build" }} + name: Pull requests from forks should use this workflow + if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - - name: Show context run: | @@ -53,13 +47,6 @@ jobs: ${{ toJson(needs) }} END echo "::endgroup::" - - - - name: Allow build - if: - run: | - "Lunching build" - - &step_checkout_head name: Checkout head @@ -94,9 +81,9 @@ jobs: generate_matrixes: - runs-on: ubuntu-20.04 #ubuntu-latest + environment: test-env + runs-on: ubuntu-20.04 needs: check_if_pull_request_comes_from_fork - #container: ubuntu:latest if: ${{ (github.event_name != 'comment') || ( github.event.comment && github.event.issue.pull_request && startsWith(github.event.comment.body, '/build') ) }} diff --git a/.github/workflows/build-iroha1-fork.yml b/.github/workflows/build-iroha1-fork.yml index 86ebadd42d8..70401cda312 100644 --- a/.github/workflows/build-iroha1-fork.yml +++ b/.github/workflows/build-iroha1-fork.yml @@ -16,11 +16,11 @@ permissions: statuses: read ## This workflow is created for pull requests from forks only and has less permissions than build-iroha1 workflow on: - #pull_request_target: - # branches: [ main, support/1.*, edge, develop, feature/DOPS-1651/enable-fork-build ] ## target branches - issue_comment: - types: [created] + pull_request_target: branches: [main, support/1.*, edge, develop, feature/DOPS-1651/enable-fork-build] + paths-ignore: + - '**.md' + - '**.rst' env: DOCKERHUB_ORG: hyperledger jobs: @@ -28,8 +28,8 @@ jobs: ## Also it checks that that .github folder and Dockerfiles are not changed check_if_pull_request_comes_from_fork: runs-on: ubuntu-20.04 #ubuntu-latest - name: Pull requests from forks should use other workflow - if: ${{ github.event.issue.comment.body == "Launch build" }} + name: Pull requests from forks should use this workflow + if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - name: Show context run: | @@ -43,10 +43,6 @@ jobs: ${{ toJson(needs) }} END echo "::endgroup::" - - name: Allow build - if: - run: | - "Lunching build" - name: Checkout head uses: actions/checkout@v2 with: @@ -74,9 +70,9 @@ jobs: echo "Pull requests from forks are not allowed to change Dockerfiles" false generate_matrixes: - runs-on: ubuntu-20.04 #ubuntu-latest + environment: test-env + runs-on: ubuntu-20.04 needs: check_if_pull_request_comes_from_fork - #container: ubuntu:latest if: ${{ (github.event_name != 'comment') || ( github.event.comment && github.event.issue.pull_request && startsWith(github.event.comment.body, '/build') ) }} steps: - name: Show context