Merge branch 'featbit:main' into main #53
This file contains 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: Contribution | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
Contribution: | |
name: Contribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: 8BitJonny/[email protected] | |
id: PR | |
- name: Extract log items | |
if: steps.PR.outputs.number != '' | |
env: | |
PR: ${{steps.PR.outputs.pr}} | |
run: | | |
contributor="${{fromJson(steps.PR.outputs.pr).user.login}}" | |
contributor_profile="${{fromJson(steps.PR.outputs.pr).user.html_url}}" | |
pr_url="${{fromJson(steps.PR.outputs.pr).html_url}}" | |
points=$(echo $PR | jq '.labels[]|select(.name|startswith("points"))' | jq '.name' | tr -d '"' | cut -d ':' -f 2) | |
echo "contributor_profile=$contributor_profile" >> $GITHUB_ENV | |
echo "pr_url=$pr_url" >> $GITHUB_ENV | |
echo "points=$points" >> $GITHUB_ENV | |
echo "now=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV | |
echo "contributor=$contributor" >> $GITHUB_ENV | |
- name: Log contribution to worksheet | |
if: ${{steps.PR.outputs.number != '' && env.points > 0}} | |
uses: jroehl/[email protected] | |
with: | |
spreadsheetId: 1ukyXgi_jRPeXj7EAST0IrnPfLOQ6xDBkcyAJY9N-Yb4 | |
commands: | # list of commands, specified as a valid JSON string | |
[ | |
{ "command": "appendData", "args": { "worksheetTitle": "data", "data": [["${{env.contributor}}", "${{env.contributor_profile}}", "${{ github.event.repository.name }}", ${{env.points}}, "${{env.now}}", "${{env.pr_url}}"]], "minCol": 1 } } | |
] | |
env: | |
GSHEET_CLIENT_EMAIL: ${{ secrets.GSHEET_CLIENT_EMAIL }} | |
GSHEET_PRIVATE_KEY: ${{ secrets.GSHEET_PRIVATE_KEY }} | |