-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
58 lines (56 loc) · 1.98 KB
/
action.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Open Journal Submission Checks
description: Perform checks on submission's repository and paper
inputs:
issue_id:
description: The review issue id for the paper
required: true
repository_url:
description: The repository URL of the submission containing the paper file
required: true
branch:
description: Git branch where the paper is located
required: false
default: ""
runs:
using: "composite"
steps:
- name: Clone repository
shell: bash
run: |
[[ "${{ inputs.branch }}" == "" ]] && (git clone --single-branch ${{ inputs.repository_url }} . ) || (git clone --single-branch --branch ${{ inputs.branch }} ${{ inputs.repository_url }} .)
- name: Run CLOC
shell: bash
run: |
sudo apt install cloc
cloc --quiet --report-file=cloc-results.txt .
echo -e "**Software report:**\n\n\`\`\`\n$(cat cloc-results.txt)\n\`\`\`" > cloc-results.txt
- name: List Git Authors
shell: bash
run: |
(git shortlog -sn --no-merges --branches .) > git-authors.txt
echo -e "**Commit count by author**:\n\n\`\`\`\n$(cat git-authors.txt)\n\`\`\`" > git-authors.txt
- name: Post repo analysis
shell: bash
run: |
echo -e "$(cat cloc-results.txt)\n\n$(cat git-authors.txt)\n" > repo-analysis.txt
gh issue comment ${{ inputs.issue_id }} --body-file repo-analysis.txt
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.4
bundler-cache: true
cache-version: submission-checks
bundler: Gemfile.lock
working-directory: ${{ github.action_path }}
- name: Analyze paper file
shell: bash
env:
ISSUE_ID: ${{ inputs.issue_id }}
REPO_URL: ${{ inputs.repository_url }}
PAPER_BRANCH: ${{ inputs.branch }}
BUNDLE_GEMFILE: ${{ github.action_path }}/Gemfile
run: |
bundle exec ruby ${{ github.action_path }}/checks.rb
branding:
icon: check-circle
color: blue