From df523dc3ba295949da120ad9c1825b7f9a941439 Mon Sep 17 00:00:00 2001 From: Johan Castiblanco <51926076+johanv26@users.noreply.github.com> Date: Thu, 31 Aug 2023 18:25:32 -0500 Subject: [PATCH] feat: create strain_dispatcher.yml feat: test some references chore: add repo to paylod chore: test my local repo that has master feat: set multiline operator chore: try to sent de pr chore: launch enviroment in payload feat: set the build_env chore: add more interesting ref data fix: solve typo in json feat: remove / from repo path chore: set correct head-ref without slaches chore: send strain path chore: return to send data withou changes chore: debug dispathcer chore: set last log commit chore: set no merges chore: checkout repo only in the main sha chore: set log commit differnet cmd this is somethind,a,, chore: set the correct of the head chad use head sha instead of merge sha chore: fix typo chore: fix another typo feat: add condition for built chore: print all chore: crazy conditional | for if The if key doesnt need the `{{}}`. https://github.com/orgs/community/discussions/25641 https://hungvu.tech/advanced-github-actions-conditional-workflow chore: set full logger feat: set better name of variables chore: fix missing `''` fix: typo of `:` fix: remove unneccesary log build: test push image fix: add correct property value build: 2test push image build: 3test push image refactor: remove strain_env in payload chore: always built images in sync chore: set property via repo vars chore: refactor strain property chore: remove commit analysis chore: run in each pull_request chore: change order of condition of the action feat: use base PAT fix: wrong syntaxis of the if feat: configure correct repo of strain chore: remove personal token use token of the action feat: use ROBONEXT_PAT --- .github/workflows/strain_dispatcher.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/strain_dispatcher.yml diff --git a/.github/workflows/strain_dispatcher.yml b/.github/workflows/strain_dispatcher.yml new file mode 100644 index 00000000..a99f7796 --- /dev/null +++ b/.github/workflows/strain_dispatcher.yml @@ -0,0 +1,37 @@ +name: Strain Repo Dispatch 📜 +on: pull_request +#strain_property go in json_path format. +jobs: + strain-dispatch: + runs-on: ubuntu-latest + steps: + - name: Manipulate strain property if necessary + run: | + echo "STRAIN_PROPERTY=${STRAIN_PROPERTY}" >> $GITHUB_ENV # update GitHub ENV vars + env: + STRAIN_PROPERTY: ${{ vars.STRAIN_PROPERTY }} + - name: Strain Repository Dispatch + if: | + github.event.action == 'opened' || + github.event.action == 'synchronize' || + (github.event.action == 'closed' && github.event.pull_request.merged) + + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.ROBONEXT_PAT }} + repository: nelc/edx-platform-strains + event-type: strain-update-pr + client-payload: | + { + "repo": "${{ github.repository }}", + "sha": "${{ github.event.pull_request.head.sha }}", + "head_ref": "${{ github.head_ref }}", + "base_ref": "${{ github.base_ref }}", + "strain_property": "${{ env.STRAIN_PROPERTY }}", + "strain_property_value": "${{ env.PROPERTY_VALUE }}", + "strain_path": "mango/nelp/strain.yml", + "pr_number": "${{ github.event.number }}", + "pr_action": "${{ github.event.action }}" + } + env: + PROPERTY_VALUE: ${{ github.event.pull_request.merged && github.base_ref || github.head_ref }}