mirror of
https://github.com/netbirdio/advisory-database.git
synced 2026-05-22 18:04:22 -07:00
repository set up
This commit is contained in:
committed by
GitHub
parent
ba762b8b06
commit
2db1feb64e
@@ -0,0 +1,26 @@
|
||||
name: Create PR staging branch
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches: [main]
|
||||
types: [opened, synchronize, reopened, edited]
|
||||
paths:
|
||||
- "advisories/**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
ensure-base-is-staging:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: ensure base is staging
|
||||
env:
|
||||
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -xeo pipefail
|
||||
BRANCH_NAME="$PR_AUTHOR"/advisory-improvement-"$PR_NUMBER"
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
git push origin "$BRANCH_NAME"
|
||||
gh pr edit --repo ${{ github.repository }} $PR_NUMBER --base "$BRANCH_NAME"
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Delete PR staging branch
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches: ["*/advisory-improvement-*"]
|
||||
types: [closed]
|
||||
paths:
|
||||
- "advisories/**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
delete-staging-branch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: delete staging branch
|
||||
env:
|
||||
STAGING_BRANCH: ${{ github.event.pull_request.base.ref }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -xeo pipefail
|
||||
git push origin --delete $STAGING_BRANCH
|
||||
Reference in New Issue
Block a user