Skip to content

Commit

Permalink
chore(CI): remove redundant bors x actions, clean up new one (#19313)
Browse files Browse the repository at this point in the history
I did a fair amount of testing, making sure that the new action has the same functionality as the old one. As far as I can tell, they work the same. The only exception could be that the new action does not remove the `awaiting-author` label, since all the tests that I saw did not have the label in the first place.
  • Loading branch information
adomani committed Nov 21, 2024
1 parent ebe784e commit bc56b5c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 197 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/add_label_from_comment.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/add_label_from_review.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/add_label_from_review_comment.yml

This file was deleted.

16 changes: 3 additions & 13 deletions .github/workflows/maintainer_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ jobs:
# both set simultaneously: depending on the event that triggers the PR, usually only one is set
env:
AUTHOR: ${{ github.event.comment.user.login }}${{ github.event.review.user.login }}
PR_NUMBER: ${{ github.event.issue.number }}${{ github.event.pull_request.number }}
COMMENT_EVENT: ${{ github.event.comment.body }}
COMMENT_REVIEW: ${{ github.event.review.body }}
PR_TITLE_ISSUE: ${{ github.event.issue.title }}
PR_TITLE_PR: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.issue.html_url }}${{ github.event.pull_request.html_url }}
EVENT_NAME: ${{ github.event_name }}
name: Add ready-to-merge or delegated label
runs-on: ubuntu-latest
steps:
Expand All @@ -43,8 +38,7 @@ jobs:
printf $'"bors delegate" or "bors merge" found? \'%s\'\n' "${m_or_d}"
printf $'AUTHOR: \'%s\'\n' "${AUTHOR}"
printf $'PR_NUMBER: \'%s\'\n' "${PR_NUMBER}"
printf $'OTHER_NUMBER: \'%s\'\n' "${{ github.event.issue.number }}${{ github.event.pull_request.number }}"
printf $'PR_NUMBER: \'%s\'\n' "${{ github.event.issue.number }}${{ github.event.pull_request.number }}"
printf $'%s' "${{ github.event.issue.number }}${{ github.event.pull_request.number }}" | hexdump -cC
printf $'mOrD=%s\n' "${m_or_d}" >> "${GITHUB_OUTPUT}"
Expand All @@ -64,9 +58,6 @@ jobs:
uses: actions-cool/check-user-permission@v2
with:
require: 'admin'
# review(_comment) use
# require: 'write'
# token: ${{ secrets.TRIAGE_TOKEN }}

- name: Add ready-to-merge or delegated label
id: add_label
Expand All @@ -75,13 +66,12 @@ jobs:
steps.merge_or_delegate.outputs.bot == 'true' ) }}
uses: octokit/[email protected]
with:
# check is this ok? was /repos/:repository/issues/:issue_number/labels
route: POST /repos/:repository/issues/:issue_number/labels
repository: ${{ github.repository }}
issue_number: ${{ github.event.issue.number }}${{ github.event.pull_request.number }}
labels: '["${{ steps.merge_or_delegate.outputs.mOrD }}"]'
env:
GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }} # comment uses ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }}

- if: ${{ ! steps.merge_or_delegate.outputs.mOrD == '' &&
( steps.user_permission.outputs.require-result == 'true' ||
Expand All @@ -92,6 +82,6 @@ jobs:
# (and send an annoying email) if the labels don't exist
run: |
curl --request DELETE \
--url "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/awaiting-author" \
--url "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}${{ github.event.pull_request.number }}/labels/awaiting-author" \
--header 'authorization: Bearer ${{ secrets.TRIAGE_TOKEN }}'
# comment uses ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bc56b5c

Please sign in to comment.