Skip to content

Commit

Permalink
chore: add backport action
Browse files Browse the repository at this point in the history
  • Loading branch information
tasso94 authored Dec 18, 2023
1 parent 7e49618 commit b2f860a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Backport merged pull request
on:
pull_request_target:
types: [closed, labeled]
permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests
jobs:
backport:
name: Backport pull request
runs-on: ubuntu-latest
# Don't run on closed unmerged pull requests
if: github.event.pull_request.merged
steps:
- name: Import Secrets
id: secrets
uses: hashicorp/[email protected]
with:
url: ${{ secrets.VAULT_ADDR }}
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
exportEnv: false
secrets: |
secret/data/products/cambpm/ci/github-workflow GITHUB_APP_ID;
secret/data/products/cambpm/ci/github-workflow GITHUB_APP_PRIVATE_KEY;
- name: Generate token for GitHub
id: generate-github-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ steps.secrets.outputs.GITHUB_APP_ID }}
private_key: ${{ steps.secrets.outputs.GITHUB_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
- name: Create backport pull requests
uses: tasso94/backport-action@main
with:
github_token: ${{ steps.generate-github-token.outputs.token }}
target_owner: ${{ github.repository_owner }}
target_repo: ${{ github.event.repository.name }}-maintenance

0 comments on commit b2f860a

Please sign in to comment.