mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 04:00:24 +08:00
63 lines
1.8 KiB
YAML
63 lines
1.8 KiB
YAML
name: Update release branch
|
|
on:
|
|
# You can trigger this workflow via workflow dispatch to start a release.
|
|
# This will open a PR to update the v2 release branch.
|
|
workflow_dispatch:
|
|
|
|
# When the v2 release is complete, this workflow will open a PR to update the v1 release branch.
|
|
push:
|
|
branches:
|
|
- releases/v2
|
|
|
|
jobs:
|
|
update:
|
|
timeout-minutes: 45
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'github/codeql-action'
|
|
steps:
|
|
- name: Dump environment
|
|
run: env
|
|
|
|
- name: Dump GitHub context
|
|
env:
|
|
GITHUB_CONTEXT: '${{ toJson(github) }}'
|
|
run: echo "$GITHUB_CONTEXT"
|
|
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
# Need full history so we calculate diffs
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install PyGithub==1.55 requests
|
|
|
|
- name: Update git config
|
|
run: |
|
|
git config --global user.email "github-actions@github.com"
|
|
git config --global user.name "github-actions[bot]"
|
|
|
|
- name: Update v2 release branch
|
|
if: github.event_name == 'workflow_dispatch'
|
|
run: |
|
|
python .github/update-release-branch.py \
|
|
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
|
--repository-nwo ${{ github.repository }} \
|
|
--mode v2-release \
|
|
--conductor ${GITHUB_ACTOR}
|
|
|
|
- name: Update v1 release branch
|
|
if: github.event_name == 'push'
|
|
run: |
|
|
python .github/update-release-branch.py \
|
|
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
|
--repository-nwo ${{ github.repository }} \
|
|
--mode v1-release \
|
|
--conductor ${GITHUB_ACTOR}
|