diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 0aac55a4..b1fe5670 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -17,7 +17,7 @@ jobs: uses: "pascalgn/automerge-action@v0.16.3" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - # MERGE_LABELS: "approved,auto merge" + MERGE_LABELS: "approved,auto merge" MERGE_METHOD: "squash" MERGE_COMMIT_MESSAGE: "automatic" MERGE_FORKS: "false" diff --git a/.github/workflows/label-on-approval.yml b/.github/workflows/label-on-approval.yml deleted file mode 100644 index a8eb9fae..00000000 --- a/.github/workflows/label-on-approval.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Add Label on Approval - -on: - pull_request_review: - types: [submitted] - -permissions: - issues: write - pull-requests: write - -jobs: - add-label: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Authenticate with GitHub App - id: auth - uses: tibdex/github-app-token@v2 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.PRIVATE_KEY }} - - - name: Set output token - id: set-token - run: echo "TOKEN=${{ steps.auth.outputs.token }}" >> $GITHUB_ENV - - - name: Check if approval is from Collaborators - uses: actions/github-script@v7 - with: - github-token: ${{ env.TOKEN }} - script: | - const { owner, repo } = context.repo; - const { pull_request, review } = context.payload; - if (!review) { - console.log('No review found.'); - return; - } - const collaborators = ['mxsm', 'TeslaRustor', 'SpaceXCN']; // Replace with actual GitHub usernames - - // Check if the review is approved and from a collaborator - const isApprovedByCollaborator = review.state === 'approved' && collaborators.includes(review.user.login); - - if (isApprovedByCollaborator) { - await github.rest.issues.addLabels({ - owner, - repo, - issue_number: pull_request.number, - labels: ['approved', 'auto merge'] - }); - }