Skip to content

Commit

Permalink
Merge pull request #92 from eduNEXT/jlc/strain-dispatcher-action
Browse files Browse the repository at this point in the history
Jlc/strain dispatcher action
  • Loading branch information
johanseto committed Sep 8, 2023
2 parents 0b51c8f + df523dc commit 2c29db3
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/strain_dispatcher.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 2c29db3

Please sign in to comment.