Skip to content

Instantly share code, notes, and snippets.

@ridvanaltun
Created August 13, 2021 20:55
Show Gist options
  • Save ridvanaltun/6fc195f72936d8056c5aebee8d245992 to your computer and use it in GitHub Desktop.
Save ridvanaltun/6fc195f72936d8056c5aebee8d245992 to your computer and use it in GitHub Desktop.
Dispatch GitHub Action From Bitbucket
# Template NodeJS build
# This template allows you to validate your NodeJS code.
# The workflow allows running tests and code linting on the default branch.
image: node:10.15.3
pipelines:
branches:
main:
- step:
name: Dispatch GitHub Action
script:
- echo 'Dispatching GitHub Action'
- curl -d "{\"event_type\":\"start-example-workflow\"}" -H "Authorization:Bearer $GITHUB_TOKEN" -X POST https://api.github.com/repos/ridvanaltun/gh-action-test/dispatches
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
repository_dispatch:
types: [start-example-workflow]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Setup SSH
uses: MrSquaare/ssh-setup-action@v1
with:
host: bitbucket.org
private-key: ${{ secrets.SSH_PRIVATE_KEY_BITBUCKET }}
private-key-name: bitbucket
- name: Clone Bitbucket repository
run: git clone git@bitbucket.org:ridvanaltun/card-collection.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment