mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 05:27:30 +01:00
CI Pipeline can only be triggered via dispatch for PRs now
This commit is contained in:
@@ -25,10 +25,6 @@ on:
|
||||
branches:
|
||||
- dev
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
- master
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pull_request_number:
|
||||
@@ -46,7 +42,7 @@ env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
concurrency:
|
||||
group: "ci-${{ github.head_ref || (github.event_name != 'push' && github.event_name != 'schedule' && github.event.inputs.pull_request_number) || github.run_id }}-${{ github.event_name }}"
|
||||
group: "ci-${{ (github.event_name != 'push' && github.event_name != 'schedule' && github.event.inputs.pull_request_number) || github.run_id }}-${{ github.event_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@@ -71,7 +67,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
@@ -145,7 +141,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Build DMAPI Test Project
|
||||
run: |
|
||||
@@ -197,7 +193,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Checkout OpenDream
|
||||
run: |
|
||||
@@ -239,7 +235,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Retrieve dotnet-ef Tool Version
|
||||
id: dotnet-ef-tool
|
||||
@@ -301,7 +297,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore
|
||||
@@ -369,7 +365,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Build Docker Image
|
||||
run: docker build . -f build/Dockerfile
|
||||
@@ -405,7 +401,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore
|
||||
@@ -454,7 +450,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore
|
||||
@@ -569,7 +565,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore
|
||||
@@ -774,7 +770,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore
|
||||
@@ -852,7 +848,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Retrieve OpenAPI Spec
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -876,7 +872,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Retrieve Linux Unit Test Coverage (Debug)
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -1162,7 +1158,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Parse TGS version
|
||||
run: |
|
||||
@@ -1243,7 +1239,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Restore Wix dotnet Tool
|
||||
run: |
|
||||
@@ -1373,7 +1369,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name != 'push' && github.event_name != 'schedule'
|
||||
with:
|
||||
ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
|
||||
ref: "refs/pull/${{ github.event.inputs.pull_request_number }}/merge"
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
name: 'CI Security'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
- master
|
||||
pull_request_target:
|
||||
types: [ opened, reopened, labeled, synchronize ]
|
||||
branches:
|
||||
@@ -17,7 +21,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
actions: write
|
||||
if: github.event_name == 'pull_request_target' && (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id || github.event.pull_request.user.id == 49699333) && github.event.pull_request.state == 'open'
|
||||
steps:
|
||||
- name: Comment on new Fork PR
|
||||
@@ -55,16 +58,23 @@ jobs:
|
||||
if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
|
||||
run: exit 1
|
||||
|
||||
- name: Dispatch CI Pipeline Workflow
|
||||
uses: lasith-kg/dispatch-workflow@5623bf13f09bbbbdb549ec692b070307f39b66ac #v2.0.0 + setup_node@v4
|
||||
with:
|
||||
dispatch-method: workflow_dispatch
|
||||
owner: ${{ github.repository_owner }}
|
||||
repo: ${{ github.event.pull_request.base.repo.name }}
|
||||
ref: ${{ github.event.pull_request.base.ref }}
|
||||
workflow: ci-pipeline.yml
|
||||
token: ${{ github.token }}
|
||||
workflow-inputs: |
|
||||
{
|
||||
"pull_request_number": "${{ github.event.pull_request.number }}"
|
||||
}
|
||||
ci-dispatch:
|
||||
name: Start CI Pipeline
|
||||
runs-on: ubuntu-latest
|
||||
needs: security-checkpoint
|
||||
permissions:
|
||||
actions: write
|
||||
steps:
|
||||
- name: Send Workflow Dispatch
|
||||
uses: lasith-kg/dispatch-workflow@5623bf13f09bbbbdb549ec692b070307f39b66ac #v2.0.0 + setup_node@v4
|
||||
with:
|
||||
dispatch-method: workflow_dispatch
|
||||
owner: ${{ github.repository_owner }}
|
||||
repo: ${{ github.event.pull_request.base.repo.name }}
|
||||
ref: ${{ github.event.pull_request.base.ref }}
|
||||
workflow: ci-pipeline.yml
|
||||
token: ${{ github.token }}
|
||||
workflow-inputs: |
|
||||
{
|
||||
"pull_request_number": "${{ github.event.pull_request.number }}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user