-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathbiotools-pullrequest-analyzer.yml
More file actions
58 lines (56 loc) · 2.05 KB
/
biotools-pullrequest-analyzer.yml
File metadata and controls
58 lines (56 loc) · 2.05 KB
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: analyze how many biotools have change on pullrequest
on:
workflow_dispatch:
jobs:
analyze:
name: Analyze biotools differences
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: content
- uses: actions/checkout@v4
with:
repository: bio-tools/content-ecosystem-utils
path: content-ecosystem-utils
- name: analyze biotools difference
env:
GITHUB_USER: ${{ secrets.GITHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sudo apt install python3-pip
sudo apt install python3-setuptools git
pip3 install gitpython
cd ${{ github.workspace }}/content
git remote add biotools-content${{ github.run_id }} https://github.com/bio-tools/content.git
git fetch biotools-content${{ github.run_id }}
git fetch origin pull/${{ github.event.number }}/head:${{ github.run_id }}
git checkout ${{ github.run_id }}
python3 ${{ github.workspace }}/content-ecosystem-utils/scripts/biotools-pullrequest-bot/biotools_pullrequest_analyzer.py ${{ github.workspace }}/content biotools-content${{ github.run_id }}/master ${{ github.run_id }} > output.txt
cat output.txt
- name: Upload output
uses: actions/upload-artifact@v4
with:
name: output
path: output.txt
comment:
needs: analyze
name: Add PR comments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download output
uses: actions/download-artifact@v4
with:
name: output
- name: copy output to workflow dir
run: |
cat ${{ github.workspace }}/content-ecosystem-utils/content/output/output.txt
mkdir -p .github/workflows/
cp ${{ github.workspace }}/content-ecosystem-utils/content/output/output.txt .github/workflows/output.txt
- name: comment under pr
uses: harupy/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: output.txt