An example GoCD Yaml config repository which uses Gocd Mergeable github action.
This repository contains GoCD configurations specified in YAML format using GoCD Yaml Config Plugin. The GoCD Mergeable github action verifies whether changes done to the GoCD configuration files are valid or not.
- Define GoCD Pipeline configurations in
dev.gocd.yaml
file
format_version: 9
pipelines:
build-on-linux:
group: dev
materials:
mygit:
git: http://example.com/mygit.git
stages:
- build:
jobs:
build:
tasks:
- exec:
command: make
environments:
dev:
environment_variables:
DEPLOYMENT_ENV: dev
pipelines:
- build-on-linux
-
Add the configuration repository to GoCD config repositories. Note the ID you've assigned to it, e.g.
gocd-mergeable-yaml-example
. -
Create
.github/workflows/gocd-mergeable.yml
to setup GoCD Mergeable Github Action.
on: [push, pull_request]
jobs:
verify_config_repository:
runs-on: ubuntu-latest
name: verify config merge.
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Verify Config Merge
uses: GaneshSPatil/gocd-mergeable@v1.0.0
with:
GOCD_SERVER_URL: 'https://build.gocd.org/go'
GOCD_ADMIN_ACCESS_TOKEN: ${{ secrets.GOCD_ADMIN_ACCESS_TOKEN }}
GOCD_CONFIG_REPOSITORY_ID: 'gocd-mergeable-yaml-example' # The ID you have assined on config repositories page on GoCD Admin UI.
GoCD Mergeable Yaml Example is an open source project, under the Apache License, Version 2.0.