feat(deps): update helm release argo-cd to v7 #404
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto PR Approve and Merge | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
auto-approve: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
# if: contains(fromJSON('["dependabot[bot]", "renovate[bot]", "sunggun-bot[bot]"]'), github.actor) | |
if: contains(fromJSON('["sunggun-bot[bot]"]'), github.actor) | |
steps: | |
- id: approve | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
retries: 3 | |
script: | | |
github.rest.pulls.createReview({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: ${{ github.event.number }}, | |
event: "APPROVE", | |
body: "auto approved" | |
}) | |
- id: add-label | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
retries: 3 | |
script: | | |
github.rest.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: ${{ github.event.number }}, | |
labels: ["auto-approved"] | |
}) | |
auto-merge: | |
runs-on: ubuntu-latest | |
needs: auto-approve | |
permissions: | |
contents: write | |
pull-requests: write | |
# if: contains(fromJSON('["dependabot[bot]", "renovate[bot]", "sunggun-bot[bot]"]'), github.actor) | |
if: contains(fromJSON('["sunggun-bot[bot]"]'), github.actor) | |
steps: | |
# should use PAT to trigger next workflow | |
# also it PR creator and approver should be different | |
- id: app-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.PRIVATE_KEY }} | |
- id: merge | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
retries: 3 | |
github-token: ${{ steps.app-token.outputs.token }} | |
script: | | |
github.rest.pulls.merge({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: ${{ github.event.number }}, | |
merge_method: "squash" | |
}) | |
- id: add-label | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
retries: 3 | |
github-token: ${{ steps.app-token.outputs.token }} | |
script: | | |
github.rest.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: ${{ github.event.number }}, | |
labels: ["auto-merged"] | |
}) |