Skip to content

Commit be76d61

Browse files
OlegOptimumCode
authored andcommitted
Trigger marking for previous version when PR from dependabot with version update is merged
1 parent 3310b2d commit be76d61

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,23 @@ jobs:
139139
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
140140

141141
mark-previous-version:
142-
needs: [build, meta]
142+
needs: [build, meta, automerge]
143143
runs-on: ubuntu-latest
144144

145-
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build.outputs.current-version != needs.meta.outputs.latest-version
145+
if: |
146+
(
147+
(github.event_name == 'push' && github.ref == 'refs/heads/main')
148+
|| (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]')
149+
)
150+
&& needs.build.outputs.current-version != needs.meta.outputs.latest-version
151+
&& !cancelled()
146152
147153
permissions:
148154
contents: write
149155

150156
env:
151157
TAG: v${{ needs.meta.outputs.latest-version }}
152-
COMMIT: ${{ github.event.before }}
158+
COMMIT: ${{ github.event.pull_request.base.ref || github.event.before }} # either the PR base ref or previous commit in the branch
153159
GH_REPOSITORY: ${{ github.repository }}
154160

155161
steps:

0 commit comments

Comments
 (0)