Skip to content

Commit 5ea69e8

Browse files
committed
fix push to main after version update
1 parent c121cc0 commit 5ea69e8

2 files changed

Lines changed: 34 additions & 15 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ permissions:
1919
actions: read
2020
contents: read
2121
packages: write
22+
pull-requests: read
2223

2324
jobs:
2425
verify-version-job:
@@ -44,6 +45,21 @@ jobs:
4445
return;
4546
}
4647
48+
const changelogPullRequests = await github.paginate(github.rest.pulls.list, {
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
state: "open",
52+
base: "main",
53+
head: `${context.repo.owner}:ci/update-changelogs`,
54+
per_page: 100,
55+
});
56+
57+
if (changelogPullRequests.length > 0) {
58+
core.info("A changelog pull request is open; skipping deploy until it is merged.");
59+
core.setOutput("should_deploy", "false");
60+
return;
61+
}
62+
4763
const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, {
4864
owner: context.repo.owner,
4965
repo: context.repo.repo,

‎.github/workflows/versioning.yml‎

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,27 @@ jobs:
116116
- name: update module changelogs
117117
run: node .github/scripts/updateModules.js
118118

119-
- name: commit changelog/module changes
120-
run: |
121-
git config user.name "github-actions[bot]"
122-
git config user.email "github-actions[bot]@users.noreply.github.com"
123-
git add src/modules
124-
git diff --cached --quiet || git commit -m "ci: update module changelogs and bump versions"
125-
git push
126-
127119
- name: update app changelogs
128120
run: node .github/scripts/updateApp.js
129121

130-
- name: commit changelog/app changes
131-
run: |
132-
git config user.name "github-actions[bot]"
133-
git config user.email "github-actions[bot]@users.noreply.github.com"
134-
git add CHANGELOG.md package.json src/client/package.json
135-
git diff --cached --quiet || git commit -m "ci: update app changelog and bump versions"
136-
git push
122+
- name: create changelog pull request
123+
uses: peter-evans/create-pull-request@v7
124+
with:
125+
token: ${{ secrets.GITHUB_TOKEN }}
126+
base: main
127+
branch: ci/update-changelogs
128+
delete-branch: true
129+
add-paths: |
130+
src/modules
131+
CHANGELOG.md
132+
package.json
133+
src/client/package.json
134+
commit-message: "ci: update changelogs and bump versions"
135+
title: "ci: update changelogs and bump versions"
136+
body: |
137+
This pull request contains the generated module and app changelog updates.
138+
139+
It was created automatically after the required test workflows completed successfully.
137140
138141
slack-finish:
139142
name: Slack final status

0 commit comments

Comments
 (0)