Skip to content

Commit c515ea9

Browse files
committed
Ignore due_on on milestones for Dependabot PRs
1 parent 8577caf commit c515ea9

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/spring-merge-dependabot-pr.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,27 @@ jobs:
111111
fi
112112
echo autoMerge=$AUTO_MERGE >> $GITHUB_OUTPUT
113113
114-
- name: Find Scheduled Milestone
115-
id: find-milestone
114+
- uses: actions/setup-java@v5
115+
if: steps.is-auto-merge.outputs.autoMerge == 'false'
116+
with:
117+
distribution: temurin
118+
java-version: 25
119+
120+
- name: Compute Version
121+
if: steps.is-auto-merge.outputs.autoMerge == 'false'
122+
id: compute-version
123+
uses: spring-io/spring-release-actions/compute-version@0.0.3
124+
125+
- name: Find Milestone for Current Version in Branch
116126
if: steps.is-auto-merge.outputs.autoMerge == 'false'
117-
uses: ./.github/spring-github-workflows/.github/actions/spring-scheduled-milestone-for-branch
127+
id: find-milestone
128+
run: |
129+
CURRENT_VERSION=${{ steps.compute-version.outputs.version }}
130+
131+
export CANDIDATE_VERSION=${CURRENT_VERSION/-SNAPSHOT}
132+
MILESTONE=$(gh api repos/$GITHUB_REPOSITORY/milestones --jq 'map(select(.title | startswith(env.CANDIDATE_VERSION))) | .[0].title')
133+
134+
echo milestone=$MILESTONE >> $GITHUB_OUTPUT
118135
119136
- name: Set Milestone to Dependabot pull request
120137
if: steps.is-auto-merge.outputs.autoMerge == 'false'
@@ -124,7 +141,7 @@ jobs:
124141
if [ -z $MILESTONE ]
125142
then
126143
gh run cancel ${{ github.run_id }}
127-
echo "::warning title=Cannot merge::No scheduled milestone for ${{ steps.find-milestone.outputs.currentVersion }} version"
144+
echo "::warning title=Cannot merge::No milestone for ${{ steps.find-milestone.outputs.currentVersion }} version"
128145
gh run watch ${{ github.run_id }}
129146
else
130147
gh pr edit ${{ github.event.pull_request.number }} --milestone $MILESTONE

0 commit comments

Comments
 (0)