Skip to content

Instantly share code, notes, and snippets.

@nmurakami0
Last active June 20, 2023 13:44
Show Gist options
  • Save nmurakami0/556ff0baf9e035a487c72c87baa29053 to your computer and use it in GitHub Desktop.
Save nmurakami0/556ff0baf9e035a487c72c87baa29053 to your computer and use it in GitHub Desktop.
create a pull request for staging
name: create a pull request for staging
on:
pull_request:
types: [ opened ]
branches: [ master ]
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set variables
run: |
echo 'PR_BODY<<EOF' >> $GITHUB_ENV
echo "the same as #${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "" >> $GITHUB_ENV
echo "---" >> $GITHUB_ENV
echo "" >> $GITHUB_ENV
echo "${{ github.event.pull_request.body }}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: pull-request
uses: repo-sync/pull-request@v2
with:
source_branch: "${{ github.event.pull_request.head.ref }}"
destination_branch: staging
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_label: staging
pr_title: "${{ github.event.pull_request.title }}"
pr_body : |
${{ env.PR_BODY }}
- name: Labeling
uses: andymckay/labeler@master
with:
add-labels: "master"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment