diff --git a/.github/workflows/deploy-doc.yml b/.github/workflows/deploy-doc.yml index bf0be0b1..0681b994 100644 --- a/.github/workflows/deploy-doc.yml +++ b/.github/workflows/deploy-doc.yml @@ -37,6 +37,24 @@ jobs: with: path: docs/.vitepress/dist + - name: Create GitHub Issue on Failure + if: failure() + uses: actions/github-script@v7 + with: + script: | + const { owner, repo } = context.repo; + const issueTitle = `build-page job failed`; + const issueBody = `The build-page job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`; + const assignees = [context.actor]; + + await github.rest.issues.create({ + owner, + repo, + title: issueTitle, + body: issueBody, + assignees + }); + deploy: environment: name: github-pages @@ -48,3 +66,21 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + + - name: Create GitHub Issue on Failure + if: failure() + uses: actions/github-script@v7 + with: + script: | + const { owner, repo } = context.repo; + const issueTitle = `deploy-page job failed`; + const issueBody = `The deploy-page job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`; + const assignees = [context.actor]; + + await github.rest.issues.create({ + owner, + repo, + title: issueTitle, + body: issueBody, + assignees + }); diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea6f5602..d2da5599 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,11 +27,31 @@ jobs: VERSION=${{ github.event.release.tag_name }} fi VERSION=${VERSION#v} + echo "VERSION=$VERSION" >> $GITHUB_ENV node ./scripts/update-version.mjs $VERSION - run: npm run release env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_2 }} + - name: Create GitHub Issue on Failure + if: failure() + uses: actions/github-script@v7 + with: + script: | + const { owner, repo } = context.repo; + const version = process.env.VERSION; + const issueTitle = `Release job for ${version} failed`; + const issueBody = `The release job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`; + const assignees = [context.actor]; + + await github.rest.issues.create({ + owner, + repo, + title: issueTitle, + body: issueBody, + assignees + }); + deploy-docs: needs: [release-package] uses: ./.github/workflows/deploy-doc.yml diff --git a/package-lock.json b/package-lock.json index 5d60c68a..baa59bf9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "version": "1.0.0-test", "license": "Apache-2.0", "dependencies": { - "@types/node": "^22.0.0" + "@types/node": "^22.0.0", + "axios": "^1.7.8" }, "devDependencies": { "@types/express": "5.0.0", @@ -1670,9 +1671,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz", - "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", + "version": "22.9.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.4.tgz", + "integrity": "sha512-d9RWfoR7JC/87vj7n+PVTzGg9hDyuFjir3RxUHbjFSKNd9mpxbxwMEyaCim/ddCmy4IuW7HjTzF3g9p3EtWEOg==", "license": "MIT", "dependencies": { "undici-types": "~6.19.8" @@ -2495,9 +2496,9 @@ "optional": true }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz", + "integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==", "license": "MIT", "optional": true, "dependencies": {