Skip to content

Commit b5e5a25

Browse files
authored
Merge branch 'main' into mario-campos/v4-warning
2 parents 74f6621 + e2ef519 commit b5e5a25

17 files changed

+87
-177
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
import re
3+
4+
# Get the PR number from the PR URL.
5+
pr_number = os.environ['PR_URL'].split('/')[-1]
6+
changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})"
7+
8+
# If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
9+
with open('CHANGELOG.md', 'r') as f:
10+
changelog = f.read()
11+
12+
changelog = changelog.replace('## [UNRELEASED]\n\nNo user facing changes.', '## [UNRELEASED]\n')
13+
14+
# Add the changelog note to the bottom of the "[UNRELEASED]" section.
15+
changelog = re.sub(r'\n## (\d+\.\d+\.\d+)', f'{changelog_note}\n\n## \\1', changelog, count=1)
16+
17+
with open('CHANGELOG.md', 'w') as f:
18+
f.write(changelog)

.github/workflows/update-bundle.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
4141
git config --global user.name "github-actions[bot]"
4242
43+
- name: Set up Python
44+
uses: actions/setup-python@v6
45+
with:
46+
python-version: '3.12'
47+
4348
- name: Set up Node.js
4449
uses: actions/setup-node@v6
4550
with:
@@ -78,28 +83,8 @@ jobs:
7883
echo "PR_URL=$pr_url" | tee -a "$GITHUB_ENV"
7984
8085
- name: Create changelog note
81-
shell: python
8286
run: |
83-
import os
84-
import re
85-
86-
# Get the PR number from the PR URL.
87-
pr_number = os.environ['PR_URL'].split('/')[-1]
88-
changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})"
89-
90-
# If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
91-
# Use perl to avoid having to escape the newline character.
92-
93-
with open('CHANGELOG.md', 'r') as f:
94-
changelog = f.read()
95-
96-
changelog = changelog.replace('## [UNRELEASED]\n\nNo user facing changes.', '## [UNRELEASED]\n')
97-
98-
# Add the changelog note to the bottom of the "[UNRELEASED]" section.
99-
changelog = re.sub(r'\n## (\d+\.\d+\.\d+)', f'{changelog_note}\n\n## \\1', changelog, count=1)
100-
101-
with open('CHANGELOG.md', 'w') as f:
102-
f.write(changelog)
87+
python .github/workflows/script/bundle_changelog.py
10388
10489
- name: Push changelog note
10590
run: |

lib/analyze-action-post.js

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild-action.js

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 5 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resolve-environment-action.js

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql-action.js

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action-post.js

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)