Skip to content

Commit

Permalink
Merge pull request #23513 from hashicorp/f/automation-changes
Browse files Browse the repository at this point in the history
automation: opening a PR when a branch named `auto-pr/deps/updating-go-azure-sdk-to-{version}` is pushed
  • Loading branch information
tombuildsstuff authored Oct 16, 2023
2 parents 679eb88 + f80165e commit dd8f6f8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/automation-open-pull-request-go-sdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Open Pull Request when an `auto-pr` is pushed for go-azure-sdk

on:
push:
branches:
- 'auto-pr/deps/updating-go-azure-sdk-to-**'

jobs:
open-pull-request:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: "open a pull request"
id: open-pr
run: |
version="$(echo {{ github.ref_name }} | sed "s/auto-pr\/deps\/updating-go-azure-sdk-to-//")"
title="dependencies: updating `hashicorp/go-azure-sdk` to `${version}`"
# this runs everytime the PR gets pushed too, whilst you can only create a PR a single time
# so we should be smarter, but piping this to /dev/null is a fine workaround for MVP
gh pr create --title "$title" --body "$PR_BODY" -B "$PR_TARGET" > /dev/null
env:
PR_BODY: "This PR updates `hashicorp/go-azure-sdk` - further details can be found in a comment."
PR_TARGET: "main"
GH_TOKEN: ${{ secrets.SERVICE_ACCOUNT_TERRAFORM_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
name: Open Pull Request when an `auto-pr` is pushed
name: Open Pull Request when an `auto-pr` is pushed for Pandora

on:
push:
branches:
- 'auto-pr/**'
branches-ignore:
- 'auto-pr/deps/updating-go-azure-sdk-to-**'

jobs:
open-pull-request:
Expand Down

0 comments on commit dd8f6f8

Please sign in to comment.