Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automation: opening a PR when a branch named auto-pr/deps/updating-go-azure-sdk-to-{version} is pushed #23513

Merged
merged 3 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"
tombuildsstuff marked this conversation as resolved.
Show resolved Hide resolved

# 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