Roman Vanicek 3585119c37
All checks were successful
continuous-integration/drone/push Build is passing
Fix passing multiple values through --container-options
2024-04-18 09:33:53 +02:00
2024-04-18 09:18:40 +02:00
2024-04-16 19:26:39 +02:00
2021-10-18 00:02:56 +05:30
2021-09-27 10:48:58 +05:30
2021-10-07 18:04:00 +05:30
2024-04-16 19:28:09 +02:00
2021-09-27 10:48:58 +05:30
2023-07-28 18:24:39 +02:00
2023-07-28 18:24:39 +02:00
2023-03-11 15:28:02 +05:30

drone-github-action-plugin

This plugin allows running github actions as a drone plugin.

Build

Build the binaries with the following commands:

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on

go build -v -a -tags netgo -o release/linux/amd64/plugin   ./cmd

Docker

Build the Docker images with the following commands:

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/Dockerfile.linux.amd64 --tag plugins/github-actions .

Plugin step usage

Provide uses, with & env of github action to use in plugin step settings. Provide GITHUB_TOKEN as environment variable if it is required for an action.

steps:
- name: github-action
  image: plugins/github-actions
  settings:
    uses: actions/hello-world-javascript-action@v1.1
    with:
        who-to-greet: Mona the Octocat
    env:
        hello: world

Running locally

  1. If you are running it on mac locally & /var/run/docker.sock file does not exist, first run this command ln -s ~/.docker/run/docker.sock /var/run/docker.sock
  2. Running actions/hello-world-javascript-action action locally via docker:

 docker run --rm \
    --privileged \
    -v $(pwd):/drone \
    -w /drone \
    -e PLUGIN_USES="actions/hello-world-javascript-action@v1.1" \
    -e PLUGIN_WITH="{\"who-to-greet\":\"Mona the Octocat\"}" \
    -e PLUGIN_VERBOSE=true \
    plugins/github-actions

Description
Run github action as a drone plugin
Readme 128 KiB
Languages
Go 97.8%
Shell 2.2%