Skip to content

Commit bc164fe

Browse files
authored
Merge branch 'master' into copy-original-pr-info-to-gen-pr
2 parents ae1c80a + a1bff9b commit bc164fe

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/workflows/generated-code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
diff=$(git --no-pager diff --name-only HEAD)
3030
echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
3131
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
32-
## Run if diff exists and pull request, and make CI status failure
33-
- if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' }}
32+
## Run if diff exists and pull request, and make CI status failure (but allow renovate bot)
33+
- if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }}
3434
run: |
3535
echo "There are changes in the generated codes. Please run 'generate-code.py' and commit the changes." >&2
3636
exit 1

.github/workflows/publish-to-pypi.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
fi
3939
4040
VERSION=${VERSION#v}
41+
echo "VERSION=$VERSION" >> $GITHUB_ENV
4142
python tools/update_version.py $VERSION
4243
- name: Build and publish
4344
env:
@@ -46,3 +47,22 @@ jobs:
4647
run: |
4748
python setup.py sdist bdist_wheel
4849
twine upload dist/*
50+
51+
- name: Create GitHub Issue on Failure
52+
if: failure()
53+
uses: actions/github-script@v7
54+
with:
55+
script: |
56+
const { owner, repo } = context.repo;
57+
const version = process.env.VERSION;
58+
const issueTitle = `Release job for ${version} failed`;
59+
const issueBody = `The release job failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`;
60+
const assignees = [context.actor];
61+
62+
await github.rest.issues.create({
63+
owner,
64+
repo,
65+
title: issueTitle,
66+
body: issueBody,
67+
assignees
68+
});

0 commit comments

Comments
 (0)