From ed766650f5d500c3f16156e977c950b3baaa396e Mon Sep 17 00:00:00 2001 From: "kirill.chalov" Date: Thu, 5 Dec 2024 14:45:04 +0800 Subject: [PATCH] feat: test posting comments --- .github/workflows/pr-deploy-preview.yml | 5 ++--- .github/workflows/pr-post-comment.yml | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pr-post-comment.yml diff --git a/.github/workflows/pr-deploy-preview.yml b/.github/workflows/pr-deploy-preview.yml index 9e301764a..a96cd3b2b 100644 --- a/.github/workflows/pr-deploy-preview.yml +++ b/.github/workflows/pr-deploy-preview.yml @@ -1,9 +1,8 @@ name: Deploy preview for PR on: - pull_request: - types: [opened, synchronize, reopened] - # branches: [main] + push: + branches: [main] # Allow manual runs from the Actions tab workflow_dispatch: diff --git a/.github/workflows/pr-post-comment.yml b/.github/workflows/pr-post-comment.yml new file mode 100644 index 000000000..acf76f9a9 --- /dev/null +++ b/.github/workflows/pr-post-comment.yml @@ -0,0 +1,21 @@ +on: + # Trigger the workflow on push or pull request + pull_request: + types: [opened, synchronize, reopened] + +jobs: + comment: + runs-on: ubuntu-latest + env: + HUGO_BASEURL: "https://preview-developer.espressif.com/pr${{ github.event.pull_request.number }}/" + steps: + - uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Test comment in PR${{ github.event.pull_request.number }} in ${{ env.HUGO_BASEURL }}!' + })