Skip to content

Commit

Permalink
Merge pull request #261 from yext/dev/automate-pr
Browse files Browse the repository at this point in the history
- add github action to create pr from master/main to develop on push to master/main (yml file from generator-slapshot repo)

J=SLAP-1357
  • Loading branch information
yen-tt committed Sep 24, 2021
2 parents 5f3b192 + 09a41f0 commit 42b49d6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/sync_develop_and_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: create PR from main to develop

on:
push:
branches: [main, master]

permissions:
contents: read
pull-requests: write

jobs:
createPullRequest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: extract package version
id: vars
run: |
PACKAGE_VERSION="v$(cat ./package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')"
echo ::set-output name=tag::${PACKAGE_VERSION}
- uses: repo-sync/pull-request@v2
with:
source_branch: "${{ github.event.repository.default_branch }}"
destination_branch: "develop"
pr_title: "Merge ${{ github.event.repository.default_branch }} (${{ steps.vars.outputs.tag }}) into develop"
pr_body: "Merge ${{ github.event.repository.default_branch }} (${{ steps.vars.outputs.tag }}) into develop"
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 42b49d6

Please sign in to comment.