mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
Use github-script for PR message (#6)
* use github-script for PR message * add create tag step
This commit is contained in:
parent
63b1c9826b
commit
171ef6e1ba
1 changed files with 25 additions and 9 deletions
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
|
|
@ -93,7 +93,7 @@ jobs:
|
||||||
|
|
||||||
docker push "${FULL_ECR_URL}:${NEW_TAG}"
|
docker push "${FULL_ECR_URL}:${NEW_TAG}"
|
||||||
|
|
||||||
- name: Create new tag and notify PR
|
- name: Create a new tag
|
||||||
if: >
|
if: >
|
||||||
inputs.create_tag == true ||
|
inputs.create_tag == true ||
|
||||||
(github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build'))
|
(github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build'))
|
||||||
|
|
@ -105,11 +105,27 @@ jobs:
|
||||||
git tag -a $NEW_TAG -m "New tag: $NEW_TAG"
|
git tag -a $NEW_TAG -m "New tag: $NEW_TAG"
|
||||||
git push origin $NEW_TAG
|
git push origin $NEW_TAG
|
||||||
|
|
||||||
PR_NUMBER=$(gh pr list --head ${{ github.ref_name }} --state merged --json number --jq '.[0].number')
|
- name: Add a release comment in PR
|
||||||
if [[ -n "$PR_NUMBER" ]]; then
|
if: >
|
||||||
echo ":rocket: A new tag ${NEW_TAG} has been created and pushed!"
|
inputs.create_tag == true ||
|
||||||
gh pr comment $PR_NUMBER -b ":rocket: A new tag ${NEW_TAG} has been created and pushed!"
|
(github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build'))
|
||||||
else
|
uses: actions/github-script@v7
|
||||||
echo ":rocket: A new tag ${NEW_TAG} has been created and pushed!"
|
id: my-script
|
||||||
echo "No open PR found for branch ${{ inputs.branch }}."
|
with:
|
||||||
fi
|
script: |
|
||||||
|
github.rest.issues.get({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: ':rocket: A new tag v(${{ steps.get-latest-tag.outputs.new-tag }}) has been created and pushed!'
|
||||||
|
})
|
||||||
|
|
||||||
|
# run: |
|
||||||
|
# PR_NUMBER=$(gh pr list --head ${{ github.ref_name }} --state merged --json number --jq '.[0].number')
|
||||||
|
# if [[ -n "$PR_NUMBER" ]]; then
|
||||||
|
# echo ":rocket: A new tag ${NEW_TAG} has been created and pushed!"
|
||||||
|
# gh pr comment $PR_NUMBER -b ":rocket: A new tag ${NEW_TAG} has been created and pushed!"
|
||||||
|
# else
|
||||||
|
# echo ":rocket: A new tag ${NEW_TAG} has been created and pushed!"
|
||||||
|
# echo "No open PR found for branch ${{ inputs.branch }}."
|
||||||
|
# fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue