From b492aee2b6784251099629509a0acabbe415d0a7 Mon Sep 17 00:00:00 2001 From: Adam DeHaven <2229946+adamdehaven@users.noreply.github.com> Date: Mon, 6 Jan 2025 10:02:17 -0500 Subject: [PATCH] ci: rename workflow jobs (#2557) --- .github/workflows/pr-on-close.yaml | 22 ++++++++++++++++++ .github/workflows/renovate-auto-approve.yaml | 24 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/pr-on-close.yaml create mode 100644 .github/workflows/renovate-auto-approve.yaml diff --git a/.github/workflows/pr-on-close.yaml b/.github/workflows/pr-on-close.yaml new file mode 100644 index 0000000000..ea4643f790 --- /dev/null +++ b/.github/workflows/pr-on-close.yaml @@ -0,0 +1,22 @@ +name: On PR close +on: + pull_request: + types: ['closed'] + +jobs: + remove-pr-preview-comment: + timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }} + name: Remove PR preview comment from PR + runs-on: ubuntu-latest + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLIC_PUBLISH }} + steps: + - name: Checkout Source Code + uses: actions/checkout@v4 + + - name: Remove preview consumption comment + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: pr_preview_consumption + delete: true + GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }} diff --git a/.github/workflows/renovate-auto-approve.yaml b/.github/workflows/renovate-auto-approve.yaml new file mode 100644 index 0000000000..b9cb3417f6 --- /dev/null +++ b/.github/workflows/renovate-auto-approve.yaml @@ -0,0 +1,24 @@ +--- +name: Renovate Bot dependency updates PR auto-merge + +permissions: + pull-requests: write + contents: write + +on: + pull_request: + types: ['opened'] + +jobs: + renovate-autoapprove: + timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }} + runs-on: ubuntu-latest + # Do not auto-approve branches `alpha` or `beta` + if: github.actor == 'renovate[bot]' && !contains(github.head_ref || github.ref_name, 'alpha') && !contains(github.head_ref || github.ref_name, 'beta') + steps: + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + # Use the bot account PAT to allow auto-approve and merge the PRs + GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}