Skip to content

Commit

Permalink
re-commit this stuff overwritten by rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Oct 31, 2023
1 parent 98f868c commit f12d30a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,21 @@
# has read permissions since the merge is coming from a fork (usually).
name: merge-labeler

# https://docs.github.com/en/rest/overview/permissions-required-for-fine-grained-personal-access-tokens?apiVersion=2022-11-28#repository-permissions-for-pull-requests
permissions:
pull-requests: write
issues: write

# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
on:
pull_request:
types:
- closed

jobs:
accept:
relabel:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
environment: merge
steps:
- uses: actions/checkout@v3
- run: |
echo ${{ github.token }} | cat >> .token
echo REPO ${{ github.repository }}
echo ID ${{ github.event.number }}
env:
MERGE_TOKEN: ${{ secrets.MERGE_TOKEN }}
run: |
perl util/merge-labeler ${{ github.repository }} ${{ github.event.number }}
7 changes: 1 addition & 6 deletions util/merge-labeler
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,12 @@ sub add_labels {
}

sub curl {
state $token = do {
open my $fh, '<', '.token';
chomp( my $line = <$fh> );
$line;
};
state $token = $ENV{MERGE_TOKEN};

my( $method, @extra ) = @_;

my $command = [
'curl',
'-v',
'--silent',
'-X', $method,
'-H', q('Accept: application/vnd.github.v3+json'),
Expand Down

0 comments on commit f12d30a

Please sign in to comment.