Workflows updates to manually merge changeset PRs and control those changes

This commit is contained in:
a8trejo
2024-12-17 17:16:46 -08:00
parent fa23dc0737
commit c9e07cca58
3 changed files with 24 additions and 8 deletions

View File

@@ -10,9 +10,14 @@ const getDependencyReleaseLine = async () => {
return ''; return '';
}; };
const getReleaseSummary = async (release) => {
return `## [${release.newVersion}]\n\n`;
};
const changelogFunctions = { const changelogFunctions = {
getReleaseLine, getReleaseLine,
getDependencyReleaseLine, getDependencyReleaseLine,
getReleaseSummary,
}; };
module.exports = changelogFunctions; module.exports = changelogFunctions;

View File

@@ -1,5 +1,5 @@
name: Changeset Release name: Changeset Release
run-name: Changeset Release ${{ github.actor != 'R00-B0T' && '- Create PR' || '- Approve & Merge' }} run-name: Changeset Release ${{ github.actor != 'R00-B0T' && '- Create PR' || '- Ready for Review' }}
on: on:
pull_request: pull_request:
@@ -84,6 +84,7 @@ jobs:
# Auto-merge PR # Auto-merge PR
- name: Automerge on PR - name: Automerge on PR
run: gh pr merge --merge ${{ github.event.pull_request.number }} if: false # Needs enablePullRequestAutoMerge in repo settings to work
run: gh pr merge --auto --merge ${{ github.event.pull_request.number }}
env: env:
GH_TOKEN: ${{ secrets.CROSS_REPO_ACCESS_TOKEN }} GH_TOKEN: ${{ secrets.CROSS_REPO_ACCESS_TOKEN }}

View File

@@ -1,16 +1,26 @@
name: Publish Extension name: Publish Extension
on: on:
push: pull_request:
branches: ["main"] types: [closed]
workflow_dispatch: workflow_dispatch:
env:
GIT_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'main' }}
jobs: jobs:
publish-extension: publish-extension:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.actor == 'R00-B0T' || github.event_name == 'workflow_dispatch' }} if: >
( github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'main' &&
contains(github.event.pull_request.title, 'Changeset version bump') ) ||
github.event_name == 'workflow_dispatch'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 with:
ref: ${{ env.GIT_REF }}
- uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 18
- run: | - run: |