56 lines
1.9 KiB
YAML
56 lines
1.9 KiB
YAML
name: Update Supported Enterprise Server Versions
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update-supported-enterprise-server-versions:
|
|
name: Update Supported Enterprise Server Versions
|
|
timeout-minutes: 45
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.repository == 'github/codeql-action' }}
|
|
|
|
steps:
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.7"
|
|
- name: Checkout CodeQL Action
|
|
uses: actions/checkout@v3
|
|
- name: Checkout Enterprise Releases
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: github/enterprise-releases
|
|
ssh-key: ${{ secrets.ENTERPRISE_RELEASES_SSH_KEY }}
|
|
path: ${{ github.workspace }}/enterprise-releases/
|
|
- name: Update Supported Enterprise Server Versions
|
|
run: |
|
|
cd ./.github/workflows/update-supported-enterprise-server-versions/
|
|
python3 -m pip install pipenv
|
|
pipenv install
|
|
pipenv run ./update.py
|
|
rm --recursive "$ENTERPRISE_RELEASES_PATH"
|
|
npm run build
|
|
env:
|
|
ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/
|
|
|
|
- name: Update git config
|
|
run: |
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config --global user.name "github-actions[bot]"
|
|
|
|
- name: Commit changes and open PR
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
if [[ -z $(git status --porcelain) ]]; then
|
|
echo "No changes to commit"
|
|
else
|
|
git checkout -b update-supported-enterprise-server-versions
|
|
git add .
|
|
git commit --message "Update supported GitHub Enterprise Server versions"
|
|
git push origin update-supported-enterprise-server-versions
|
|
gh pr create --fill --draft
|
|
fi
|