Macos support #115
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CLA Signature | |
| on: | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| cla-sign: | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, 'I have read the CLA Document and I hereby sign the CLA') && github.event.comment.user.login != 'cla-bot[bot]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Add contributor | |
| run: | | |
| USERNAME="${{ github.event.comment.user.login }}" | |
| # Read current contributors | |
| CONTRIBUTORS=$(cat .contributors) | |
| # Check if already signed | |
| if echo "$CONTRIBUTORS" | grep -q "\"$USERNAME\""; then | |
| echo "Already signed" | |
| exit 0 | |
| fi | |
| # Add new contributor | |
| echo "$CONTRIBUTORS" | jq --arg user "$USERNAME" '. += [$user]' > .contributors | |
| # Configure git | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Commit and push | |
| git add .contributors | |
| git commit -m "Add $USERNAME to CLA signatories" | |
| git push | |
| - name: Trigger recheck | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: '@cla-bot check' | |
| }) |