Skip to content

Commit e188c4b

Browse files
authored
Merge pull request #1 from ziadhany/vcs-collector
Add support for collecting fix commits and (PRs and issues)
2 parents d1dd341 + 32ce455 commit e188c4b

11 files changed

Lines changed: 1479 additions & 1 deletion
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Hourly sync for collecting fix commits
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 * * * *'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
scheduled:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install required packages
25+
run: pip install GitPython==3.1.46 packageurl-python==0.17.6 aboutcode.pipeline==0.2.1
26+
27+
- name: Run sync
28+
run: python fix_commits_collector.py
29+
30+
- name: Commit and push if it changed
31+
run: |-
32+
git config user.name "AboutCode Automation"
33+
git config user.email "automation@aboutcode.org"
34+
git add -A
35+
timestamp=$(date -u)
36+
git commit -m "$(echo -e "Sync Collecting Fix Commits: $timestamp\n\nSigned-off-by: AboutCode Automation <automation@aboutcode.org>")" || exit 0
37+
git push
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Hourly sync for collecting issues and pull requests
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 * * * *'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
scheduled:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install required packages
25+
run: pip install PyGithub==2.8.1 python-dotenv==1.2.2 packageurl-python==0.17.6 python-gitlab==8.1.0 aboutcode.pipeline==0.2.1
26+
27+
- name: Run sync
28+
env:
29+
GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }}
30+
GLAB_API_TOKEN: ${{ secrets.GLAB_API_TOKEN }}
31+
run: python issues_prs_collector.py
32+
33+
- name: Commit and push if it changed
34+
run: |-
35+
git config user.name "AboutCode Automation"
36+
git config user.email "automation@aboutcode.org"
37+
git add -A
38+
timestamp=$(date -u)
39+
git commit -m "$(echo -e "Sync Collecting Issues and Pull requests related to vulnerabilities: $timestamp\n\nSigned-off-by: AboutCode Automation <automation@aboutcode.org>")" || exit 0
40+
git push

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.env

0 commit comments

Comments
 (0)