mirror of
https://github.com/github/codeql.git
synced 2026-05-25 00:27:09 +02:00
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: Sync Main
|
|
on:
|
|
schedule:
|
|
- cron: '55 * * * *'
|
|
jobs:
|
|
sync-main:
|
|
name: Sync-main
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'microsoft/codeql'
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.WORKFLOW_TOKEN }}
|
|
- name: Git config
|
|
shell: bash
|
|
run: |
|
|
git config user.name Dilan Bhalla
|
|
git config user.email dilanbhalla@microsoft.com
|
|
- name: Sync Main
|
|
shell: bash
|
|
run: |
|
|
set -x
|
|
git fetch
|
|
git remote add upstream https://github.com/github/codeql.git
|
|
git fetch upstream --tags --force
|
|
git merge codeql-cli/latest
|
|
- name: Setup CodeQL
|
|
shell: bash
|
|
run: |
|
|
gh extension install github/gh-codeql
|
|
gh codeql version
|
|
printf "CODEQL_FETCHED_CODEQL_PATH=" >> "${GITHUB_ENV}"
|
|
gh codeql version --format=json | jq -r .unpackedLocation >> "${GITHUB_ENV}"
|
|
gh codeql version --format=json | jq -r .unpackedLocation >> "${GITHUB_PATH}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
- name: Compile PowerShell Queries
|
|
run: |
|
|
codeql query compile --check-only --keep-going powershell/ql/src
|
|
- name: Complete Sync
|
|
shell: bash
|
|
run: |
|
|
git push origin main
|
|
git push origin --tags --force
|
|
|