Skip to content

Commit ae4a05f

Browse files
Release v1.9.4 (#446)
Co-authored-by: simoneb <[email protected]>
1 parent 757a893 commit ae4a05f

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

dist/index.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5548,6 +5548,8 @@ exports.request = request;
55485548

55495549

55505550
const core = __nccwpck_require__(2186)
5551+
const newOrg = 'nearform-actions'
5552+
const oldOrg = 'nearform'
55515553

55525554
/**
55535555
* Displays warning message if the action reference is pinned to master/main
@@ -5575,21 +5577,33 @@ function logActionRefWarning() {
55755577
*/
55765578
function logRepoWarning() {
55775579
const actionRepo = process.env.GITHUB_ACTION_REPOSITORY
5580+
const action = process.env.GITHUB_ACTION
5581+
55785582
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(/([^_]+$)/)
55805587

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)
55905590
}
55915591
}
55925592

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+
55935607
module.exports = {
55945608
logActionRefWarning,
55955609
logRepoWarning

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-action-notify-release",
3-
"version": "1.9.3",
3+
"version": "1.9.4",
44
"description": "Github action for notifying of a pending release",
55
"main": "dist/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)