@@ -18,10 +18,10 @@ jobs:
1818 name : Idle check
1919 runs-on : ubuntu-latest
2020 outputs :
21- days : ${{ steps.idle.outputs.days }}
21+ active : ${{ steps.idle.outputs.active }}
2222
2323 steps :
24- - name : GitHub Script idle counter
24+ - name : GitHub Script idle check
2525 id : idle
2626 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
2727 with :
@@ -31,15 +31,15 @@ jobs:
3131 repo: context.repo.repo,
3232 branch: 'main',
3333 });
34- const days = Math.floor(( new Date() - new Date(branch.commit.commit.author.date)) / 86400000).toString() ;
35- core.info(`Days : ${days }`);
36- core.setOutput("days ", days );
34+ const active = new Date() - new Date(branch.commit.commit.author.date) <= 90 * 86400000;
35+ core.info(`Active : ${active }`);
36+ core.setOutput("active ", active );
3737
38- github-commit :
39- name : GitHub commit
38+ github-commits :
39+ name : GitHub commits
4040 needs : idle
4141 runs-on : ubuntu-latest
42- if : needs.idle.outputs.days <= 90
42+ if : needs.idle.outputs.active
4343 outputs :
4444 dependency-fragments : ${{ steps.commits.outputs.fragments }}
4545
@@ -67,42 +67,53 @@ jobs:
6767 run : |
6868 echo "fragments=$(python .github/scripts/platformio/GitHubCommit.py)" >> "$GITHUB_OUTPUT"
6969
70- github-commit-handler :
71- name : GitHub commit
72- needs : github-commit
70+ github-commit-dependency :
71+ name : GitHub commit dependency
72+ needs : github-commits
7373 runs-on : ubuntu-latest
74- if : needs.github-commit .outputs.dependency-fragments != '[]'
74+ if : needs.github-commits .outputs.dependency-fragments != '[]'
7575
7676 strategy :
7777 matrix :
78- fragments : ${{ fromJson(needs.github-commit .outputs.dependency-fragments) }}
78+ fragments : ${{ fromJson(needs.github-commits .outputs.dependency-fragments) }}
7979
8080 steps :
8181 - name : Checkout
8282 uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
8383
84+ - name : Git branch check
85+ id : branch
86+ run : |
87+ if git ls-remote --exit-code --heads origin "dependabot/platformio/${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}-${{ matrix.fragments.version_new }}"; then
88+ echo "exists=1" >> "$GITHUB_OUTPUT"
89+ else
90+ echo "exists=0" >> "$GITHUB_OUTPUT"
91+ fi
92+
8493 - name : Update platformio.ini
94+ if : steps.branch.outputs.exists == false
8595 run : sed -i "s|${{ matrix.fragments.string_old }}|${{ matrix.fragments.string_new }}|g" platformio.ini
8696
8797 - name : Create Pull Request
88-
98+ if : steps.branch.outputs.exists == false
8999 uses : peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
90100 id : pr
91101 with :
92- title : Bump ${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }} from ${{ matrix.fragments.version_old }} to ${{ matrix.fragments.version_new }} in /
93- branch : dependabot/platformio/${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}-${{ matrix.fragments.version_new }}
102+ author : github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
94103 body : |
95104 Bumps [${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}](https://github.com/${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}) from ${{ matrix.fragments.version_old }} to ${{ matrix.fragments.version_new }}.
96- - [Release notes](https://github.com/${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}/releases)
97- - [Diff](https://github.com/${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}/compare/${{ matrix.fragments.commit_old }}...${{ matrix.fragments.commit_new }})
105+ - [Releases](https://github.com/${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}/releases)
106+ - [Compare changes](https://github.com/${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}/compare/${{ matrix.fragments.commit_old }}...${{ matrix.fragments.commit_new }})
107+ branch : dependabot/platformio/${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }}-${{ matrix.fragments.version_new }}
98108 commit-message : Bump ${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }} from ${{ matrix.fragments.version_old }} to ${{ matrix.fragments.version_new }} in /
99109 labels : |
100110 dependencies
101111 firmware
102112 milestone : ${{ env.milestone }}
113+ title : Bump ${{ matrix.fragments.owner }}/${{ matrix.fragments.repo }} from ${{ matrix.fragments.version_old }} to ${{ matrix.fragments.version_new }} in /
103114
104115 - name : GitHub Script close superseded
105- if : steps.pr .outputs.pull-request-operation == 'created'
116+ if : steps.branch .outputs.exists == false
106117 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
107118 with :
108119 script : |
@@ -142,10 +153,10 @@ jobs:
142153 }
143154
144155 platformio-registry :
145- name : PlatformIO registry
156+ name : PlatformIO Registry
146157 needs : idle
147158 runs-on : ubuntu-latest
148- if : needs.idle.outputs.days <= 90
159+ if : needs.idle.outputs.active
149160 outputs :
150161 dependency-fragments : ${{ steps.registry.outputs.fragments }}
151162
@@ -173,8 +184,8 @@ jobs:
173184 run : |
174185 echo "fragments=$(python .github/scripts/platformio/PlatformIoRegistry.py)" >> "$GITHUB_OUTPUT"
175186
176- platformio-registry-handler :
177- name : PlatformIO Registry
187+ platformio-registry-dependency :
188+ name : PlatformIO Registry dependency
178189 needs : platformio-registry
179190 runs-on : ubuntu-latest
180191 if : needs.platformio-registry.outputs.dependency-fragments != '[]'
@@ -187,26 +198,38 @@ jobs:
187198 - name : Checkout
188199 uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
189200
201+ - name : Git branch check
202+ id : branch
203+ run : |
204+ if git ls-remote --exit-code --heads origin "dependabot/platformio/${{ matrix.fragments.owner }}/${{ matrix.fragments.name }}-${{ matrix.fragments.version_new }}"; then
205+ echo "exists=1" >> "$GITHUB_OUTPUT"
206+ else
207+ echo "exists=0" >> "$GITHUB_OUTPUT"
208+ fi
209+
190210 - name : Update platformio.ini
211+ if : steps.branch.outputs.exists == false
191212 run : sed -i "s|${{ matrix.fragments.string_old }}|${{ matrix.fragments.string_new }}|g" platformio.ini
192213
193214 - name : Create Pull Request
215+ if : steps.branch.outputs.exists == false
194216 uses : peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
195217 id : pr
196218 with :
197- title : Bump ${{ matrix.fragments.owner }}/${{ matrix.fragments.name }} from ${{ matrix.fragments.version_old }} to ${{ matrix.fragments.version_new }} in /
198- branch : dependabot/platformio/${{ matrix.fragments.owner }}/${{ matrix.fragments.name }}-${{ matrix.fragments.version_new }}
219+ author : github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
199220 body : |
200221 Bumps [${{ matrix.fragments.owner }}/${{ matrix.fragments.name }}](https://registry.platformio.org/${{ matrix.fragments.type }}/${{ matrix.fragments.owner }}/${{ matrix.fragments.name }}) from ${{ matrix.fragments.version_old }} to ${{ matrix.fragments.version_new }}.
201222 - [Releases](https://registry.platformio.org/${{ matrix.fragments.type }}/${{ matrix.fragments.owner }}/${{ matrix.fragments.name }}/versions)
223+ branch : dependabot/platformio/${{ matrix.fragments.owner }}/${{ matrix.fragments.name }}-${{ matrix.fragments.version_new }}
202224 commit-message : Bump ${{ matrix.fragments.owner }}/${{ matrix.fragments.name }} from ${{ matrix.fragments.version_old }} to ${{ matrix.fragments.version_new }} in /
203225 labels : |
204226 dependencies
205227 firmware
206228 milestone : ${{ env.milestone }}
229+ title : Bump ${{ matrix.fragments.owner }}/${{ matrix.fragments.name }} from ${{ matrix.fragments.version_old }} to ${{ matrix.fragments.version_new }} in /
207230
208231 - name : GitHub Script close superseded
209- if : steps.pr .outputs.pull-request-operation == 'created'
232+ if : steps.branch .outputs.exists == false
210233 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
211234 with :
212235 script : |
0 commit comments