Skip to content

Commit cbc54d7

Browse files
authored
Tweak commit message/PR for auto-updates (#118)
Closes #117
1 parent 16dca76 commit cbc54d7

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/workflows/autoupdate.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@ jobs:
3434
# If the current HEAD is different then a commit was made, so make a PR.
3535
- run: |
3636
if [ "${{ github.sha }}" != $(git rev-parse HEAD) ]; then
37-
time=`date '+%Y-%m-%d'`
3837
branch=update-$time
3938
git checkout -b $branch
4039
git push origin $branch:$branch
41-
gh pr create \
42-
--title "Auto-update for $time" \
43-
--fill
40+
gh pr create --fill
4441
fi
4542
env:
4643
GH_TOKEN: ${{ github.token }}

update-testsuite.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import shutil
1414
import subprocess
1515
import sys
16+
from datetime import datetime
1617

1718

1819
class GitError(RuntimeError):
@@ -214,7 +215,8 @@ def main():
214215
if len(updated) == 0:
215216
print('No spec changes found, not creating a new commit')
216217
return 0
217-
message = 'Update repos:\n\n'
218+
today = datetime.now().strftime("%Y-%m-%d")
219+
message = f'Auto-update for {today}\n\nUpdate repos:\n\n'
218220
for repo in updated:
219221
message += f' {repo.dir}:\n'
220222
message += f' {repo.url()}/commit/{repo.rev}\n'

0 commit comments

Comments
 (0)