Skip to content

Instantly share code, notes, and snippets.

@javigomez
Created October 13, 2022 14:54
Show Gist options
  • Save javigomez/742a1c2ad0b9a86471fe883639e2fd87 to your computer and use it in GitHub Desktop.
Save javigomez/742a1c2ad0b9a86471fe883639e2fd87 to your computer and use it in GitHub Desktop.
sourcegraph batch changes example
name: migrate-gha-runners-to-ephemeral
description: This batch change migrates GHA runners to ephemeral
on:
# Find all repositories that contain [self-hosted, {runner}] without -ephemeral suffix
- repositoriesMatchingQuery: context:global content:"runs-on:" NOT content:"-ephemeral" lang:yaml file:.github/workflows/* patternType:literal
# Describe the changeset (e.g., GitHub pull request) you want for each repository.
changesetTemplate:
title: 'build(NOJIRA-1234): migrate GHA runners to ephemeral'
body: Updates GHA runners to ephemeral runners. For more info check [this](https://www.notion.so/typeform/Migration-to-Ephemeral-runners-ffd85bafaed44cfd8a0c135701c4a6a7)
branch: NOJIRA-1234-ephemeral-runners
commit:
message: 'build(NOJIRA-1234): migrate GHA runners to ephemeral'
published: true
steps:
- run: |
comby \
-in-place \
'runs-on::[~\s?][:[~\s?]self-hosted,:[~\s?]:[runner]:[~\s?]]' \
'runs-on: [self-hosted, :[runner]-ephemeral]' \
.github/workflows/*.yml || true
container: comby/comby
- run: |
comby \
-in-place \
'runs-on::[~\s?][:[~\s?]self-hosted,:[~\s?]:[runner]:[~\s?]]' \
'runs-on: [self-hosted, :[runner]-ephemeral]' \
.github/workflows/*.yaml || true
container: comby/comby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment