From ff3b4146454aee5f88825f03909072cf0b1c23d3 Mon Sep 17 00:00:00 2001 From: Pranshu Chittora Date: Tue, 17 May 2022 17:23:06 +0530 Subject: [PATCH 1/2] feat: signoz gh-bot integration --- .github/workflows/comment-on-pr.yml | 31 +++++++++++++++++++ .../workflows/create-issue-on-pr-merge.yml | 27 ++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/comment-on-pr.yml create mode 100644 .github/workflows/create-issue-on-pr-merge.yml diff --git a/.github/workflows/comment-on-pr.yml b/.github/workflows/comment-on-pr.yml new file mode 100644 index 0000000000..1ac39ef8e4 --- /dev/null +++ b/.github/workflows/comment-on-pr.yml @@ -0,0 +1,31 @@ +on: + pull_request: + +env: + GITHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_USERNAME }} + PR_NUMBER: ${{ github.event.number }} +jobs: + comment_on_pr: + name: PR comment + runs-on: ubuntu-latest + steps: + - name: Check ENV + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + run: echo $DOCKERHUB_USERNAME + - name: Checkout Codebase + uses: actions/checkout@v2 + with: + repository: signoz/gh-bot + - name: Use Node v16 + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Setup Cache & Install Dependencies + uses: bahmutov/npm-install@v1 + with: + install-command: yarn --frozen-lockfile + - name: Comment on PR + run: node pr-comment.js + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.CI_BOT_TOKEN }} diff --git a/.github/workflows/create-issue-on-pr-merge.yml b/.github/workflows/create-issue-on-pr-merge.yml new file mode 100644 index 0000000000..12910628ed --- /dev/null +++ b/.github/workflows/create-issue-on-pr-merge.yml @@ -0,0 +1,27 @@ +on: + pull_request_target: + types: + - closed + +env: + GITHUB_ACCESS_TOKEN: ${{ secrets.CI_BOT_TOKEN }} + PR_NUMBER: ${{ github.event.number }} +jobs: + create_issue_on_merge: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout Codebase + uses: actions/checkout@v2 + with: + repository: signoz/gh-bot + - name: Use Node v16 + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Setup Cache & Install Dependencies + uses: bahmutov/npm-install@v1 + with: + install-command: yarn --frozen-lockfile + - name: Comment on PR + run: node create-issue.js From 9e6d918d6a4fd07c924d2635692123b47efb75f3 Mon Sep 17 00:00:00 2001 From: Pranshu Chittora Date: Fri, 20 May 2022 12:37:33 +0530 Subject: [PATCH 2/2] fix: removed comment of PR workflow --- .github/workflows/comment-on-pr.yml | 31 ----------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/comment-on-pr.yml diff --git a/.github/workflows/comment-on-pr.yml b/.github/workflows/comment-on-pr.yml deleted file mode 100644 index 1ac39ef8e4..0000000000 --- a/.github/workflows/comment-on-pr.yml +++ /dev/null @@ -1,31 +0,0 @@ -on: - pull_request: - -env: - GITHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_USERNAME }} - PR_NUMBER: ${{ github.event.number }} -jobs: - comment_on_pr: - name: PR comment - runs-on: ubuntu-latest - steps: - - name: Check ENV - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - run: echo $DOCKERHUB_USERNAME - - name: Checkout Codebase - uses: actions/checkout@v2 - with: - repository: signoz/gh-bot - - name: Use Node v16 - uses: actions/setup-node@v2 - with: - node-version: 16 - - name: Setup Cache & Install Dependencies - uses: bahmutov/npm-install@v1 - with: - install-command: yarn --frozen-lockfile - - name: Comment on PR - run: node pr-comment.js - env: - GITHUB_ACCESS_TOKEN: ${{ secrets.CI_BOT_TOKEN }}