ckeditor5-integrations.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. # This script triggers Travis that verifies whether projects that depend on CKEditor 5 build correctly.
  2. #
  3. # In order to integrate the action in a new repository, you need add a few secrets in the new repository.
  4. # - INTEGRATION_CI_ORGANIZATION - a name of the organization that keeps the repository where the build should be triggered
  5. # - INTEGRATION_CI_REPOSITORY - a name of the repository where the build should be triggered
  6. # - INTEGRATION_CI_TRAVIS_TOKEN - an authorization token generated by Travis CLI: `travis --pro token`
  7. name: CKEditor 5 Integrations
  8. on:
  9. push:
  10. branches: [ master ]
  11. jobs:
  12. build:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Trigger CI
  16. env:
  17. WORKFLOW_TRIGGER_REPOSITORY: ${{ github.repository }}
  18. WORKFLOW_TRIGGER_COMMIT: ${{ github.sha }}
  19. WORKFLOW_ORGANIZATION: ${{ secrets.INTEGRATION_CI_ORGANIZATION }}
  20. WORKFLOW_REPOSITORY: ${{ secrets.INTEGRATION_CI_REPOSITORY }}
  21. WORKFLOW_TRAVIS_TOKEN: ${{ secrets.INTEGRATION_CI_TRAVIS_TOKEN }}
  22. run: |
  23. export BUILD_MESSAGE="Repository: $WORKFLOW_TRIGGER_REPOSITORY\n\nCommit: https://github.com/$WORKFLOW_TRIGGER_REPOSITORY/commit/$WORKFLOW_TRIGGER_COMMIT."
  24. export REQUEST_BODY="{\"request\": { \"branch\": \"master\", \"message\": \"$BUILD_MESSAGE\" } }"
  25. curl -s -X POST \
  26. -H "Content-Type: application/json" \
  27. -H "Accept: application/json" \
  28. -H "Travis-API-Version: 3" \
  29. -H "Authorization: token $WORKFLOW_TRAVIS_TOKEN" \
  30. -d "$REQUEST_BODY" \
  31. "https://api.travis-ci.com/repo/$WORKFLOW_ORGANIZATION%2F$WORKFLOW_REPOSITORY/requests"