Teppei Fukuda 8b9bdf21bc
build: replace PAT with ORG_REPO_TOKEN (#245)
Signed-off-by: knqyf263 <knqyf263@gmail.com>
2023-09-28 11:17:51 +03:00

36 lines
978 B
YAML

name: Squash vuln-list repo
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'
jobs:
squash:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install git-filter-repo
- name: Setup GitHub user email and name
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Clone a shallow repo
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/vuln-list
token: ${{ secrets.ORG_REPO_TOKEN }}
path: vuln-list
fetch-depth: 2000
- name: Squash and push
run: |
cd vuln-list
git replace -f --graft $(git rev-list --max-parents=0 HEAD)
git filter-repo --force
git push --force --set-upstream https://${{ secrets.ORG_REPO_TOKEN }}@github.com/${{ github.repository_owner }}/vuln-list.git main