From a0c51c08e3c66db17a88cc7bc4fb75ee49990294 Mon Sep 17 00:00:00 2001 From: Dilan Sachintha Nayanajith Date: Wed, 25 Oct 2023 09:52:25 +0530 Subject: [PATCH 1/2] Add update_spec workflow --- .github/workflows/update_spec.yml | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/update_spec.yml diff --git a/.github/workflows/update_spec.yml b/.github/workflows/update_spec.yml new file mode 100644 index 0000000..7815278 --- /dev/null +++ b/.github/workflows/update_spec.yml @@ -0,0 +1,48 @@ +name: Update Specifications + +env: + SPEC_FOLDER_PATH: 'docs/spec' + +on: + workflow_dispatch: + push: + branches: + - master + paths: + - 'docs/spec/**' + +jobs: + update_specs: + name: Update Specifications + if: github.repository_owner == 'ballerina-platform' + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + - name: Get Repo Name + id: repo_name + run: | + MODULE=${{ github.event.repository.name }} + echo "::set-output name=short_name::${MODULE##*-}" + + - name: Trigger Workflow + run: | + curl --request POST \ + 'https://api.github.com/repos/ballerina-platform/ballerina-dev-website/dispatches' \ + -H 'Accept: application/vnd.github.v3+json' \ + -H 'Authorization: Bearer ${{ secrets.BALLERINA_BOT_TOKEN }}' \ + --data "{ + \"event_type\": \"update-stdlib-specs\", + \"client_payload\": { + \"module_name\": \"${{ github.event.repository.name }}\", + \"short_name\": \"${{ steps.repo_name.outputs.short_name }}\", + \"file_dir\": \"${{ github.event.repository.name }}/${{ env.SPEC_FOLDER_PATH }}\", + \"release_date\": \"${{ steps.date.outputs.date }}\" + } + }" From 4ce584143a647c0cfb91c474d03da0fb32657a24 Mon Sep 17 00:00:00 2001 From: Dilan Sachintha Nayanajith Date: Wed, 25 Oct 2023 09:53:05 +0530 Subject: [PATCH 2/2] Update update_spec.yml --- .github/workflows/update_spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_spec.yml b/.github/workflows/update_spec.yml index 7815278..f9358ec 100644 --- a/.github/workflows/update_spec.yml +++ b/.github/workflows/update_spec.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: push: branches: - - master + - main paths: - 'docs/spec/**'