File tree Expand file tree Collapse file tree 5 files changed +19
-14
lines changed
Expand file tree Collapse file tree 5 files changed +19
-14
lines changed Original file line number Diff line number Diff line change 2020 notes="${notes//'%'/'%25'}"
2121 notes="${notes//$'\n'/'%0A'}"
2222 notes="${notes//$'\r'/'%0D'}"
23- echo "::set-output name= RELEASE_NOTES:: $notes"
23+ echo "RELEASE_NOTES= $notes" >> $GITHUB_OUTPUT
2424 shell : bash
Original file line number Diff line number Diff line change @@ -59,4 +59,4 @@ for tag in "${tagsToUpdate[@]}"; do
5959 git push origin " $tag " --force
6060done
6161
62- echo " ::set-output name= PUBLISHED:: $PUBLISHED "
62+ echo " PUBLISHED= $PUBLISHED " >> $GITHUB_OUTPUT
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 }}
1816 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 : GitHub Action Deploy to WP Engine
23- id : deploy
2421 uses : ./
2522 with :
2623 # Deploy vars
@@ -33,19 +30,26 @@ 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://ghae2e.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
43+ if : ${{ !cancelled() }}
3844 needs : run_action
3945 steps :
40- - name : Validate deploy results
41- run : |
42- [ ${{needs.run_action.outputs.status}} = "pass" ] || exit 1
4346 - name : Notify slack on failure
44- if : failure() && github.ref == 'refs/heads/main'
47+ if : needs.run_action.result == ' failure' && github.ref == 'refs/heads/main'
4548 env :
4649 SLACK_BOT_TOKEN : ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
4750 uses : voxmedia/github-action-slack-notify-build@v1
4851 with :
49- channel : status-github-action
52+ # Channel: status-github-action
53+ channel_id : C03QDL9U0TW
5054 status : FAILED
5155 color : danger
Original file line number Diff line number Diff line change 3737
3838 - name : Get current version
3939 id : version
40- run : echo "::set-output name= CURRENT_VERSION:: $(node -p "require('./package.json').version")"
40+ run : echo "CURRENT_VERSION= $(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
4141
4242 release :
4343 name : Release
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
@@ -25,8 +26,8 @@ echo "Old test plugin version: $BEFORE_PLUGIN_VERSION"
2526# Check that the expected update was made
2627if [ -z " $BEFORE_PLUGIN_VERSION " ] || [ -z " $AFTER_PLUGIN_VERSION " ] || [ " $BEFORE_PLUGIN_VERSION " = " $AFTER_PLUGIN_VERSION " ]; then
2728 echo " Failure: Test plugin was not updated!"
28- echo " ::set-output name= status::fail "
29+ echo " { \" status\" : \" failure \" } " > $PLUGINS_DIR / $PLUGIN_NAME / $STATUS_FILE
2930else
3031 echo " Success: Test plugin successfully updated from $BEFORE_PLUGIN_VERSION to $AFTER_PLUGIN_VERSION !"
31- echo " ::set-output name= status::pass "
32+ echo " { \" status\" : \" success \" } " > $PLUGINS_DIR / $PLUGIN_NAME / $STATUS_FILE
3233fi
You can’t perform that action at this time.
0 commit comments