mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-02 14:59:53 +08:00
Context: * Update the workflows to use repository secrets instead of environment secrets
47 lines
1.6 KiB
YAML
47 lines
1.6 KiB
YAML
# This workflow will create backport Pull Requests whenever a pull request with
|
|
# the appropriate labels is merged.
|
|
name: Backport
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- closed
|
|
|
|
# Limit the permissions on the GitHub token for this workflow to the subset
|
|
# that is required. In this case, the backport workflow needs to be able to
|
|
# create branches and create/update PRs, so it needs write access to
|
|
# "pull-requests" and "contents" permissions.
|
|
permissions:
|
|
pull-requests: write
|
|
contents: write
|
|
|
|
jobs:
|
|
backport-pull-request:
|
|
name: Backport Pull Request
|
|
if: github.event.pull_request.merged == true
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Generate GitHub Token
|
|
id: generate_token
|
|
uses: tibdex/github-app-token@v1
|
|
with:
|
|
app_id: ${{ secrets.REVIEWERS_APP_ID }}
|
|
private_key: ${{ secrets.REVIEWERS_PRIVATE_KEY }}
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: master
|
|
# Checkout main branch of shared-workflow repository.
|
|
- name: Checkout shared-workflow
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: gravitational/shared-workflows
|
|
path: .github/shared-workflows
|
|
ref: main
|
|
- name: Installing Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version-file: .github/shared-workflows/bot/go.mod
|
|
# Run "check" subcommand on bot.
|
|
- name: Backport PR
|
|
run: ( cd .github/shared-workflows/bot && go build ) && .github/shared-workflows/bot/bot -workflow=backport -token="${{ steps.generate_token.outputs.token }}" -reviewers="${{ secrets.reviewers }}"
|