aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/approve-merged-contributor.yml
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-29 02:54:38 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-29 02:54:53 +0300
commit73d92004f50d3f5fafe64e0f9b7fddbcf4d99965 (patch)
tree73038acf832d0595d7deca6fc26b66bc1bd0a3ff /.github/workflows/approve-merged-contributor.yml
parenta5920bee86f47023b74133dad7464b07af77ce69 (diff)
ci: remove approved contributor bypass
Diffstat (limited to '.github/workflows/approve-merged-contributor.yml')
-rw-r--r--.github/workflows/approve-merged-contributor.yml64
1 files changed, 0 insertions, 64 deletions
diff --git a/.github/workflows/approve-merged-contributor.yml b/.github/workflows/approve-merged-contributor.yml
deleted file mode 100644
index 6bcec009..00000000
--- a/.github/workflows/approve-merged-contributor.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-name: Approve Merged Contributor
-
-on:
- pull_request_target:
- types: [closed]
-
-jobs:
- approve:
- if: ${{ github.event.pull_request.merged == true }}
- runs-on: ubuntu-latest
- permissions:
- contents: read
- steps:
- - name: Checkout
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- with:
- ref: ${{ github.event.repository.default_branch }}
- persist-credentials: false
-
- - name: Add merged contributor to approved list
- id: update
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
- with:
- github-token: ${{ secrets.KANGAL_GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
-
- const prAuthor = context.payload.pull_request.user.login;
- const approvedFile = '.github/APPROVED_CONTRIBUTORS';
-
- if (prAuthor.endsWith('[bot]') || prAuthor === 'dependabot[bot]') {
- console.log(`Skipping bot: ${prAuthor}`);
- core.setOutput('status', 'skipped');
- return;
- }
-
- let content = fs.readFileSync(approvedFile, 'utf8');
- const approvedList = content
- .split('\n')
- .map(line => line.trim().toLowerCase())
- .filter(line => line && !line.startsWith('#'));
-
- if (approvedList.includes(prAuthor.toLowerCase())) {
- console.log(`${prAuthor} is already approved`);
- core.setOutput('status', 'already');
- return;
- }
-
- content = content.trimEnd() + '\n' + prAuthor + '\n';
- fs.writeFileSync(approvedFile, content);
-
- console.log(`Added ${prAuthor} to approved contributors`);
- core.setOutput('status', 'added');
-
- - name: Commit and push
- if: steps.update.outputs.status == 'added'
- env:
- KANGAL_GITHUB_TOKEN: ${{ secrets.KANGAL_GITHUB_TOKEN }}
- run: |
- git config user.name "kangal-bot"
- git config user.email "285672167+kangal-bot@users.noreply.github.com"
- git add .github/APPROVED_CONTRIBUTORS
- git diff --staged --quiet || git commit -m "chore: approve merged contributor ${{ github.event.pull_request.user.login }}"
- git push "https://x-access-token:${KANGAL_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:${{ github.event.repository.default_branch }}