Skip to content

Commit 503a121

Browse files
fix: Add dependency for update job completion before Bors merges (#43)
The changelog and msrv updates got missed in the last PR, bc the job hadn't completed yet but `done` wasn't configured to wait. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 6b042d8 commit 503a121

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
# default_author: github_actions
105105
# message: "[skip ci] Update CHANGELOG from Github Actions"
106106

107-
update_project_stuff:
107+
update-project-stuff:
108108
uses: ./.github/workflows/update-repo-stuff.yml
109109
secrets: inherit
110110

@@ -113,7 +113,7 @@ jobs:
113113
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
114114
needs:
115115
- ci
116-
#- commit_changelog
116+
- update-project-stuff
117117
runs-on: ubuntu-latest
118118
steps:
119119
- name: Done

.github/workflows/update-repo-stuff.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
env:
77
CHANGELOG_FILENAME: CHANGELOG.md
88
DEFAULT_BRANCH: main
9-
ADD_PR_LABELS: bot
9+
ADD_PR_LABELS: bot-updated
1010
RESTART_PR_DELAY: 15s
1111
GIT_BOT_USERNAME: github-actions[bot]
1212
GIT_BOT_EMAIL: github-actions[bot]@users.noreply.github.com
@@ -197,6 +197,9 @@ jobs:
197197
path: ${{ env.CHANGELOG_FILENAME }}
198198
retention-days: 1
199199

200+
# In the future, we should find a way to skip this step for the final build
201+
# after msrv and changelog have been updated
202+
# possibly using labels on PR
200203
generate_msrv:
201204
name: Generate Minimum Supported Rust Version badge
202205
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
@@ -257,11 +260,11 @@ jobs:
257260
name: ${{ env.CHANGELOG_FILENAME }}
258261
path: .
259262

260-
- name: Download ${{ env.CHANGELOG_FILENAME }}
263+
- name: Download msrv-badge.svg
261264
uses: actions/download-artifact@v2
262265
with:
263266
name: msrv-badge.svg
264-
path: .
267+
path: .github/assets
265268

266269
#- name: Check repo
267270
# run: |
@@ -272,16 +275,19 @@ jobs:
272275
id: auto-commit-action
273276
uses: stefanzweifel/git-auto-commit-action@v4.14.1
274277
with:
275-
commit_message: "Updating ${{ env.CHANGELOG_FILENAME }} [actions skip]"
278+
commit_message: "Updating ${{ env.CHANGELOG_FILENAME }} and/or MSRV badge [actions skip]"
276279
commit_user_name: ${{ env.GIT_BOT_USERNAME }}
277280
commit_user_email: ${{ env.GIT_BOT_EMAIL }}
278281
commit_author: ${{ env.GIT_BOT_USERNAME }} <${{ env.GIT_BOT_EMAIL }}>
279282

283+
# Make sure labels are created first
280284
- name: Wait, then restart Bors and label PR
281285
if: ${{ steps.auto-commit-action.outputs.changes_detected == 'true' }}
282286
env:
283287
GH_TOKEN: ${{ steps.app.outputs.token }}
284288
run: |
289+
290+
printf "Changelog and/or MSRV badge was updated.\n\nBors will cancel job, but no action is required. Job will be restarted." | gh pr comment ${{ needs.get_pr_info.outputs.pr_number }} --body-file -
285291
sleep ${{ env.RESTART_PR_DELAY }}
286292
gh pr edit ${{ needs.get_pr_info.outputs.pr_number }} --add-label ${{ env.ADD_PR_LABELS }}
287293
printf "Updated changelog before staging build.\nbors r+" | gh pr comment ${{ needs.get_pr_info.outputs.pr_number }} --body-file -

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Add short git URL notation support ([#28](https://github.com/tjtelan/git-url-parse-rs/issues/28))
1313
- Add MSRV badge ([#36](https://github.com/tjtelan/git-url-parse-rs/issues/36))
1414
- Add personal access token to checkout ([#41](https://github.com/tjtelan/git-url-parse-rs/issues/41))
15+
- Add pre-merge generated updates ([#42](https://github.com/tjtelan/git-url-parse-rs/issues/42))
1516

1617
### Fixed
1718

1819
- Update CHANGELOG from Github Actions
1920
- Make changelog update fixup to PR commit ([#33](https://github.com/tjtelan/git-url-parse-rs/issues/33))
2021
- Fix post pr workflow ([#37](https://github.com/tjtelan/git-url-parse-rs/issues/37))
2122
- Post PR: Include all PR files with changelog commit with `--all` ([#38](https://github.com/tjtelan/git-url-parse-rs/issues/38))
23+
- Add dependency for update job completion before Bors merges ([#43](https://github.com/tjtelan/git-url-parse-rs/issues/43))
2224

2325
### Other
2426

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ categories = ["parser-implementations", "encoding"]
44
description = "A parser for git repo urls based on url crate"
55
documentation = "https://docs.rs/git-url-parse"
66
edition = "2021"
7-
keywords = ["git", "url", "parsing"]
7+
keywords = ["git", "url", "parsing", "normalize"]
88
license = "MIT"
99
name = "git-url-parse"
1010
readme = "README.md"

0 commit comments

Comments
 (0)