Remove push notification, ignore error when there's no breaking change.

This commit is contained in:
hezijie 2022-11-23 16:47:37 +08:00
Родитель 6925e48c48
Коммит 184a06c9e1
2 изменённых файлов: 1 добавлений и 31 удалений

Просмотреть файл

@ -19,6 +19,7 @@ jobs:
run_id: ${{ github.event.workflow_run.id }}
workflow: pr-check.yaml
name: change
if_no_artifact_found: ignore
- name: Check change existence
id: check_change
uses: andstor/file-existence-action@v1

31
.github/workflows/main-branch-push.yaml поставляемый
Просмотреть файл

@ -1,31 +0,0 @@
name: Main Branch Push
on:
push:
branches:
- main
- master
jobs:
main-branch-push:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: 8BitJonny/gh-get-current-pr@2.1.0
id: PR
# checkov:skip=CKV_GHA_3 bypass check for CKV_GHA_3 since the GITHUB_TOKEN will be a one-time token https://docs.bridgecrew.io/docs/suspicious-use-of-curl-with-secrets
- name: Warn remaining PR branch
run: |
echo "=====> Query remaining pull requests"
response=$(curl \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/pulls?per_page=100)
export pr_number=$(echo "$response" | jq '.[].number')
echo "=====> Warn pull requests branch"
for p in $pr_number; do
curl -s -X POST -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/issues/$p/comments -d "{\"body\":\"MAIN BRANCH PUSH DETECTED DUE TO #${{steps.PR.outputs.number}}, THIS PR NEED TO BE UPDATED TO TRIGGER CI.\"}"
done