File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ permissions:
1919 actions : read
2020 contents : read
2121 packages : write
22+ pull-requests : read
2223
2324jobs :
2425 verify-version-job :
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,
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments