File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 1313jobs :
1414 run_action :
1515 runs-on : ubuntu-latest
16- outputs :
17- status : ${{ steps.deploy.outputs.status }}
18- steps :
16+ steps :
1917 - uses : actions/checkout@v3
2018 - name : Bump test plugin version number
2119 run : sed -i 's/0.0.1/0.0.2/' tests/data/plugins/test-plugin/test-plugin.php
2220 - name : Deploy to WP Engine
23- id : deploy
2421 uses : ./.github/actions/deploy
2522 with :
2623 # Deploy vars
@@ -33,16 +30,21 @@ jobs:
3330 FLAGS : ' -r --backup --backup-dir=/tmp --itemize-changes'
3431 SCRIPT : " tests/data/post-deploy/test-plugin.sh"
3532 CACHE_CLEAR : true
36- validate_result :
33+ - name : Fetch deploy results
34+ id : fetchResult
35+ uses : fjogeleit/http-request-action@v1
36+ with :
37+ url : " https://sitedeploye2e.wpengine.com/wp-content/plugins/test-plugin/status.json"
38+ - name : Validate deploy results
39+ run : |
40+ [ ${{ fromJson(steps.fetchResult.outputs.response).status }} = "success" ] || exit 1
41+ notify :
3742 runs-on : ubuntu-latest
3843 if : ${{ !cancelled() }}
3944 needs : run_action
4045 steps :
41- - name : Validate deploy results
42- run : |
43- [ ${{needs.run_action.outputs.status}} = "pass" ] || exit 1
4446 - name : Notify slack on failure
45- if : failure() && github.ref == 'refs/heads/main'
47+ if : needs.run_action.result == ' failure' && github.ref == 'refs/heads/main'
4648 env :
4749 SLACK_BOT_TOKEN : ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
4850 uses : voxmedia/github-action-slack-notify-build@v1
Original file line number Diff line number Diff line change 33BACKUP_DIR=/tmp
44PLUGINS_DIR=wp-content/plugins
55PLUGIN_NAME=test-plugin
6+ STATUS_FILE=status.json
67
78cleanup () {
89 rm tests/data/post-deploy/test-plugin.sh
@@ -26,8 +27,8 @@ echo "Old test plugin version: $BEFORE_PLUGIN_VERSION"
2627# Check that the expected update was made
2728if [ -z " $BEFORE_PLUGIN_VERSION " ] || [ -z " $AFTER_PLUGIN_VERSION " ] || [ " $BEFORE_PLUGIN_VERSION " = " $AFTER_PLUGIN_VERSION " ]; then
2829 echo " Failure: Test plugin was not updated!"
29- echo " ::set-output name= status::fail "
30+ echo " { \" status\" : \" failure \" } " > $PLUGINS_DIR / $PLUGIN_NAME / $STATUS_FILE
3031else
3132 echo " Success: Test plugin successfully updated from $BEFORE_PLUGIN_VERSION to $AFTER_PLUGIN_VERSION !"
32- echo " ::set-output name= status::pass "
33+ echo " { \" status\" : \" success \" } " > $PLUGINS_DIR / $PLUGIN_NAME / $STATUS_FILE
3334fi
You can’t perform that action at this time.
0 commit comments