@@ -5548,6 +5548,8 @@ exports.request = request;
5548
5548
5549
5549
5550
5550
const core = __nccwpck_require__(2186)
5551
+ const newOrg = 'nearform-actions'
5552
+ const oldOrg = 'nearform'
5551
5553
5552
5554
/**
5553
5555
* Displays warning message if the action reference is pinned to master/main
@@ -5575,21 +5577,33 @@ function logActionRefWarning() {
5575
5577
*/
5576
5578
function logRepoWarning() {
5577
5579
const actionRepo = process.env.GITHUB_ACTION_REPOSITORY
5580
+ const action = process.env.GITHUB_ACTION
5581
+
5578
5582
const [repoOrg, repoName] = actionRepo.split('/')
5579
- const newOrg = 'nearform-actions'
5583
+ let parentActionOrg, parentActionRepo
5584
+ ;[, parentActionOrg] = action.match(/__(.*)_/)
5585
+ parentActionOrg = parentActionOrg.replace('_', '-')
5586
+ ;[parentActionRepo] = action.match(/([^_]+$)/)
5580
5587
5581
- if (repoOrg != newOrg) {
5582
- core.warning(
5583
- `The '${repoName}' action, no longer exists under the '${repoOrg}' organisation.\n` +
5584
- `Please update it to '${newOrg}', you can do this\n` +
5585
- `by updating your Github Workflow file from:\n\n` +
5586
- ` uses: '${repoOrg}/${repoName}'\n\n` +
5587
- `to:\n\n` +
5588
- ` uses: '${newOrg}/${repoName}'\n\n`
5589
- )
5588
+ if (repoOrg === oldOrg || parentActionOrg === oldOrg) {
5589
+ return warning(repoOrg === oldOrg ? repoName : parentActionRepo)
5590
5590
}
5591
5591
}
5592
5592
5593
+ /**
5594
+ * Simple function to avoid the repetition of the message
5595
+ */
5596
+ function warning(repoName) {
5597
+ return core.warning(
5598
+ `The '${repoName}' action, no longer exists under the '${oldOrg}' organisation.\n` +
5599
+ `Please update it to '${newOrg}', you can do this\n` +
5600
+ `by updating your Github Workflow file from:\n\n` +
5601
+ ` uses: '${oldOrg}/${repoName}'\n\n` +
5602
+ `to:\n\n` +
5603
+ ` uses: '${newOrg}/${repoName}'\n\n`
5604
+ )
5605
+ }
5606
+
5593
5607
module.exports = {
5594
5608
logActionRefWarning,
5595
5609
logRepoWarning
0 commit comments