Create PRs to reflect publish changes (#743)
* Create PRs to reflect publish changes * Using gh instead of third party action * Adding github token
This commit is contained in:
parent
ec336b92aa
commit
5a49be1322
30
.github/workflows/publish.yml
vendored
30
.github/workflows/publish.yml
vendored
@ -14,6 +14,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
PublishBranch: publish/${{github.ref_name }}-${{ github.run_id }}-${{ github.run_number }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'check successful status'
|
- name: 'check successful status'
|
||||||
run: |
|
run: |
|
||||||
@ -38,6 +40,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global user.email "github-actions@github.com"
|
git config --global user.email "github-actions@github.com"
|
||||||
git config --global user.name "Github Actions"
|
git config --global user.name "Github Actions"
|
||||||
|
- name: 'Checkout new branch'
|
||||||
|
run: |
|
||||||
|
git checkout -b $PublishBranch
|
||||||
|
git push -u origin $PublishBranch
|
||||||
- name: 'install dependencies'
|
- name: 'install dependencies'
|
||||||
run: |
|
run: |
|
||||||
yarn -D
|
yarn -D
|
||||||
@ -49,9 +55,23 @@ jobs:
|
|||||||
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
PUBLISH_PRERELEASE: ${{ github.event.inputs.prerelease }}
|
PUBLISH_PRERELEASE: ${{ github.event.inputs.prerelease }}
|
||||||
- name: 'merge into main branch'
|
- name: 'Create PR to merge into ref branch'
|
||||||
if: github.event.inputs.prerelease == '' # unless it's a prerelease
|
|
||||||
run: |
|
run: |
|
||||||
git checkout main && \
|
gh pr create \
|
||||||
git merge ${{ github.ref }} && \
|
-B ${{ github.ref_name }} \
|
||||||
git push
|
-H $PublishBranch \
|
||||||
|
--title "Publish: CHANGELOG and Package Version Updates into ${{ github.ref_name }}" \
|
||||||
|
--body "Syncing CHANGELOG and package version updates from publish action ${{github.run_id}}-${{github.run_number}} into ${{ github.ref_name}} branch" \
|
||||||
|
--reviewer ${{ github.actor }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
- name: 'Create PR to merge ref branch into main'
|
||||||
|
run: |
|
||||||
|
gh pr create \
|
||||||
|
-B main \
|
||||||
|
-H ${{ github.ref_name }} \
|
||||||
|
--title "Publish: Sync ${{ github.ref_name }} into main " \
|
||||||
|
--body "Syncing ${{ github.ref_name }} back into main after publish action. NOTE: this PR should be merged after CHANGELOG and package version updates have been merged into ${{ github.ref_name }}" \
|
||||||
|
--reviewer ${{ github.actor }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user