From 829cc11c2cd2a14d450cf0219d47f399075134b7 Mon Sep 17 00:00:00 2001 From: Rajan Vijayan Date: Tue, 17 Sep 2024 00:53:14 +0530 Subject: [PATCH 1/3] Responce Message Update --- includes/Helper/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Helper/Response.php b/includes/Helper/Response.php index 4c5fd0f..c09e961 100644 --- a/includes/Helper/Response.php +++ b/includes/Helper/Response.php @@ -159,7 +159,7 @@ public static function not_implemented($key = '') { * @return WP_REST_Response The response object with a 500 status code. */ public static function error($key = '') { - $message = Globals::get_success_message('error'); + $message = Globals::get_success_message($key); return self::create_response(500, $message); } } \ No newline at end of file From 8e197543e114fde918a8ad54adcc9a7400c40e89 Mon Sep 17 00:00:00 2001 From: Rajan Vijayan Date: Tue, 17 Sep 2024 01:02:07 +0530 Subject: [PATCH 2/3] update release workflow --- .github/workflows/release.yaml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c9f5437..a9fd2c1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: version: - description: 'Version name for the release' + description: 'Version name for the release (e.g., 1.0.0)' required: true default: '1.0.0' - + jobs: build: runs-on: ubuntu-latest @@ -26,7 +26,13 @@ jobs: run: composer install --no-dev - name: Get version from user input - run: echo "VERSION=${{ github.event.inputs.version || '1.0.0' }}" >> $GITHUB_ENV + run: | + VERSION=${{ github.event.inputs.version }} + # Ensure that the version is prefixed with "v" for a valid tag name + if [[ $VERSION != v* ]]; then + VERSION="v${VERSION}" + fi + echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Cleanup unnecessary files run: | @@ -42,9 +48,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} with: - tag_name: v${{ env.VERSION }} - release_name: SM Plugin v${{ env.VERSION }} - body: "Initial release of the SM Plugin plugin." + tag_name: ${{ env.VERSION }} # Use the validated version tag + release_name: SM Plugin ${{ env.VERSION }} + body: "Release of SM Post Connector plugin version ${{ env.VERSION }}." draft: false prerelease: false @@ -56,4 +62,4 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./sm-post-connector-package.zip asset_name: sm-post-connector-package.zip - asset_content_type: application/zip + asset_content_type: application/zip \ No newline at end of file From c366c3956f004a68332e6b4bd06f82bc26da386a Mon Sep 17 00:00:00 2001 From: Rajan Vijayan Date: Tue, 17 Sep 2024 01:33:41 +0530 Subject: [PATCH 3/3] remove docs files while deployment --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a9fd2c1..5a48b92 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -40,7 +40,7 @@ jobs: - name: Zip the plugin run: | - zip -r sm-post-connector-package.zip . -x "*.git*" -x "*.github*" -x "*.yml" -x "phpunit.xml" -x "tests/**" + zip -r sm-post-connector-package.zip . -x "*.git*" -x "*.github*" -x "*.yml" -x "phpunit.xml" -x "tests/**" -x "docs/**" - name: Create Release id: create_release