Repository and paper info #27
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: Paper checks | |
on: | |
workflow_dispatch: | |
inputs: | |
repository_url: | |
description: 'URL of the repository where the paper file is: org/reponame' | |
required: true | |
branch: | |
description: 'Git branch with the paper file' | |
required: false | |
default: "" | |
issue_id: | |
description: 'The issue number of the submission to post the results' | |
required: true | |
wordcount: | |
description: 'Count the number of words in the paper file' | |
required: false | |
default: true | |
statement_of_need: | |
description: 'Look for an Statement Of Need section in the paper content' | |
required: false | |
default: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.PDF_BOT_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
jobs: | |
read-paper: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
run: | | |
[[ ${{ github.event.inputs.branch }} == ""]] && echo($(git clone --single-branch ${{ github.event.inputs.repository_url }} . )) || git clone --single-branch --branch ${{ github.event.inputs.branch }} ${{ github.event.inputs.repository_url }} . | |
- name: install CLOC | |
run: sudo apt install cloc | |
- name: run CLOC | |
run: cloc --quiet --report-file=cloc-results.txt ${{ github.workspace }} | |
- name: Post results | |
run: | | |
echo -e "\`\`\`\nSoftware report:\n\n$(cat cloc-results.txt)\n\`\`\`" > cloc-results.txt | |
gh issue comment ${{ github.event.inputs.issue_id }} --body-file cloc-results.txt | |
- name: List Git Authors | |
run: | | |
git --version | |
ls -la | |
git status | |
echo "$(git shortlog -sn --no-merges)" > git-authors.txt | |
echo -e "\`\`\`\nThe following historical commit information, by author, was found:\n\n$(cat git-authors.txt)\n\`\`\`" > git-authors.txt | |
gh issue comment ${{ github.event.inputs.issue_id }} --body-file git-authors.txt |