Skip to content

Commit

Permalink
Automatically add milestone to new Pull Request (#12759)
Browse files Browse the repository at this point in the history
* Automatically add milestone to new Pull Request

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Run the workflow on pull_request_target event

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Use gh pr edit to add milestone

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Use bash instead of go script

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

---------

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
frouioui authored Apr 3, 2023
1 parent 746c37f commit bdf59b8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/assign_milestone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Assign Milestone

on:
pull_request_target:
types: [opened]

permissions: read-all

env:
GH_TOKEN: ${{ github.token }}

jobs:
build:
name: Assign Milestone
runs-on: ubuntu-22.04
permissions:
pull-requests: write

steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.2

- name: Checkout code
uses: actions/checkout@v3

- name: Assign Milestone
run: |
gh pr edit ${{ github.event.number }} --milestone "v$(sed -n 's/.*versionName.*\"\([[:digit:]\.]*\).*\"/\1/p' ./go/vt/servenv/version.go)"

0 comments on commit bdf59b8

Please sign in to comment.