mirror of
https://github.com/actions/publish-action.git
synced 2025-06-01 18:10:44 +02:00
Update error message, set permissions in the workflow
This commit is contained in:
parent
827de551fd
commit
ead7541b7c
@ -17,9 +17,12 @@ defaults:
|
|||||||
jobs:
|
jobs:
|
||||||
update_tag:
|
update_tag:
|
||||||
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
|
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
|
||||||
|
# Remember to configure the releaseNewActionVersion environment with required approvers in the repository settings
|
||||||
environment:
|
environment:
|
||||||
name: releaseNewActionVersion
|
name: releaseNewActionVersion
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@ -36,7 +39,7 @@ jobs:
|
|||||||
-X POST `
|
-X POST `
|
||||||
-H 'Content-type: application/json' `
|
-H 'Content-type: application/json' `
|
||||||
--data '{\"text\":\"Failed to update a major tag for the ${{ github.repository }} action\"}' `
|
--data '{\"text\":\"Failed to update a major tag for the ${{ github.repository }} action\"}' `
|
||||||
${{ secrets.SLACK }}
|
${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|
||||||
- name: Send slack message
|
- name: Send slack message
|
||||||
if: success()
|
if: success()
|
||||||
@ -45,4 +48,4 @@ jobs:
|
|||||||
-X POST `
|
-X POST `
|
||||||
-H 'Content-type: application/json' `
|
-H 'Content-type: application/json' `
|
||||||
--data '{\"text\":\"The ${{ steps.update-major-tag.outputs.major-tag }} tag has been successfully updated for the ${{ github.repository }} action to include changes from the ${{ env.TAG_NAME }}\"}' `
|
--data '{\"text\":\"The ${{ steps.update-major-tag.outputs.major-tag }} tag has been successfully updated for the ${{ github.repository }} action to include changes from the ${{ env.TAG_NAME }}\"}' `
|
||||||
${{ secrets.SLACK }}
|
${{ secrets.SLACK_WEBHOOK }}
|
4
dist/index.js
vendored
4
dist/index.js
vendored
@ -42,7 +42,7 @@ async function findTag(tag, octokitClient) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw err;
|
throw new Error(`Retrieving refs failed with the following error: ${err}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ async function validateIfReleaseIsPublished(tag, octokitClient) {
|
|||||||
throw new Error(`No GitHub release found for the ${tag} tag`);
|
throw new Error(`No GitHub release found for the ${tag} tag`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw err;
|
throw new Error(`Retrieving releases failed with the following error: ${err}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "publish-action",
|
"name": "publish-action",
|
||||||
"version": "1.0.0",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "publish-action",
|
"name": "publish-action",
|
||||||
"version": "1.0.0",
|
"version": "0.1.0",
|
||||||
"description": "Update the major version tag (v1, v2, etc.) to point to the specified tag",
|
"description": "Update the major version tag (v1, v2, etc.) to point to the specified tag",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -28,7 +28,9 @@ async function findTag(
|
|||||||
if (err.status === 404) {
|
if (err.status === 404) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw new Error(
|
||||||
|
`Retrieving refs failed with the following error: ${err}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,7 +70,9 @@ export async function validateIfReleaseIsPublished(
|
|||||||
`No GitHub release found for the ${tag} tag`
|
`No GitHub release found for the ${tag} tag`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw new Error(
|
||||||
|
`Retrieving releases failed with the following error: ${err}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user