Skip to content

dataquest -> lindat sync #27

dataquest -> lindat sync

dataquest -> lindat sync #27

# This workflow will attempt to port a merged pull request to
# the branch specified in a "port to" label (if exists)
name: Port merged Pull Request
# Only run for merged PRs against the "main" or maintenance branches
# We allow this to run for `pull_request_target` so that github secrets are available
# (This is required when the PR comes from a forked repo)
on:
pull_request_target:
types: [ closed ]
branches:
- clarin-v7
issue_comment:
types: [created]
permissions:
contents: write # so action can add comments
pull-requests: write # so action can create pull requests
jobs:
port_pr:
runs-on: ubuntu-latest
# Don't run on closed *unmerged* pull requests
if: >
(
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
) || (
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/backport')
)
steps:
# Grab stronger auth token
# We are cherry-picking our commits on top of a remote branch
# the remote might have different workflows
# normally github actions (using GITHUB_TOKEN) cannot modify workflows
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
# Checkout code
- uses: actions/checkout@v6
with:
token: ${{ steps.app-token.outputs.token }}
# Port PR to other branch (ONLY if labeled with "port to")
- name: Port pull requests
uses: kosarko/backport-action@44f5afb93822657a4de40932496f6fd5dae3a617
with:
github_token: ${{ steps.app-token.outputs.token }}
# Trigger based on a "port to [branch]" label on PR
# (This label must specify the branch name to port to)
label_pattern: '^port to ([^ ]+)$'
# Title to add to the (newly created) port PR
pull_title: '[Port ${target_branch}] ${pull_title}'
# Description to add to the (newly created) port PR
pull_description: 'Port of #${pull_number} by @${pull_author} to `${target_branch}`.'
# Skip any merge commits in the ported PR. This means only non-merge commits are cherry-picked to the new PR
merge_commits: 'skip'
experimental: |
{
"downstream_repo": "dspace-angular",
"downstream_owner": "dataquest-dev"
}