-
-
Notifications
You must be signed in to change notification settings - Fork 18
40 lines (36 loc) · 1.25 KB
/
accept_signature.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Accept new signature
concurrency:
group: one-at-a-time
cancel-in-progress: false
on:
issues:
types: [closed]
permissions:
contents: write
jobs:
add-signature:
runs-on: ubuntu-latest
if: ${{ github.actor != github.event.issue.user.login }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Add the signment of user
if: ${{ github.actor != 'github-actions[bot]' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUMBER: ${{ github.event.issue.number }}
USER: ${{ github.event.issue.user.login }}
NAME: ${{ github.event.issue.title }}
ID: ${{ github.event.issue.user.id }}
run: |
if grep -qi "@$USER" ./README.md; then
echo "Preventing the duplicate signature..."
else
sed -i 's;### Con 💛 JSCL.Eng;'"| $NAME | [@$USER](https://github.com/$USER) |"';' ./README.md
echo -e "\n### Con 💛 JSCL.Eng" >> ./README.md
git config --global user.email "[email protected]"
git config --global user.name "$USER"
git add .
git commit -m "feat: Acuerdo firmado por $USER en la issue #$NUMBER"
git push origin main
fi