-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e9a5b9
commit a0c51c0
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }}\" | ||
} | ||
}" |