From c63af2108eed769016fd9f8c25b227d79812184f Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Tue, 16 May 2023 11:12:50 +0530 Subject: [PATCH] ci: switch back to official label copier & always add `ok-to-test` label Signed-off-by: Rakshith R --- .github/workflows/mergify-copy-labels.yaml | 8 ++--- .../action.yaml | 33 ------------------- 2 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 actions/gha-mergify-merge-queue-labels-copier/action.yaml diff --git a/.github/workflows/mergify-copy-labels.yaml b/.github/workflows/mergify-copy-labels.yaml index 3e3cd78cc..e47422fc3 100644 --- a/.github/workflows/mergify-copy-labels.yaml +++ b/.github/workflows/mergify-copy-labels.yaml @@ -11,9 +11,7 @@ jobs: mergify-merge-queue-labels-copier: runs-on: ubuntu-latest steps: - - name: Checkout the repository to get the local action - uses: actions/checkout@v3 - - name: Copying labels - # FIXME: using local instead of Mergifyio/gha-mergify-merge-queue-labels-copier@main - uses: ./actions/gha-mergify-merge-queue-labels-copier/ + uses: Mergifyio/gha-mergify-merge-queue-labels-copier@main + with: + additional-labels: 'ok-to-test' diff --git a/actions/gha-mergify-merge-queue-labels-copier/action.yaml b/actions/gha-mergify-merge-queue-labels-copier/action.yaml deleted file mode 100644 index eb46dc5ef..000000000 --- a/actions/gha-mergify-merge-queue-labels-copier/action.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# yamllint disable rule:line-length -# -# Fork of Mergifyio/gha-mergify-merge-queue-labels-copier@main with modified -# startsWith() check. -# -# See: https://docs.github.com/en/actions/learn-github-actions/expressions#startswith -# -name: 'mergify-merge-queue-labels-copier' -description: 'Mergify: copies pull request labels to merge queue draft PRs' -inputs: - labels: - description: 'Comma separated list of labels to copy (all if empty)' - required: true - default: '' -runs: - using: "composite" - steps: - - name: Copying labels - shell: bash - if: startsWith(github.head_ref, 'mergify/merge-queue/') - env: - REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }} - MERGE_QUEUE_PR_URL: ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }} - GH_TOKEN: ${{ github.token }} - run: | - gh pr view --json body -q ".body" $MERGE_QUEUE_PR_URL | sed -n -e '/```yaml/,/```/p' | sed -e '1d;$d' | yq '.pull_requests[]|.number' | while read pr_number ; do - gh pr view --json labels -q '.labels[]|.name' ${REPOSITORY_URL}/pull/$pr_number | while read label ; do - if [[ -z "$labels" ]] || [[ ",$labels," =~ ",$label," ]]; then - gh pr edit --add-label "$label" $MERGE_QUEUE_PR_URL - if - done - done