Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
SWi-1991 Update LTS Release Table Job (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoegel authored Mar 27, 2023
1 parent ab524d7 commit aa18765
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions .github/workflows/lts-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,26 @@ jobs:
needs: [lts_needed, create_lts]
if: ${{!needs.lts_needed.outputs.no_release}}
steps:
- name: Get Latest LTS Releases and Update the LTS config file
run: |
cat > lts.config.json <<< $(jq -r '[nth(0,1,2,3,4,5,6,7,8,9,10,11;.[] | select(.name | match(".+LTS")) | .name | rtrimstr("-LTS"))] | unique | reverse' <<< $(curl -Ls -H "Accept: application/vnd.github+json" -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/Bandwidth/api-docs/releases))
env:
TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3

- uses: actions/checkout@v3
- name: Configure Git and Create Branch
run: |
git config user.email "[email protected]"
git config user.name "DX-Bandwidth"
git checkout -b auto-update-lts
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Get Latest LTS Releases and Update LTS Config File
run: |
cat > ./site/lts.config.json <<< $(jq -r '[nth(0,1,2,3,4,5,6,7,8,9,10,11;.[] | select(.name | match(".+LTS")) | .name | rtrimstr("-LTS"))] | unique | reverse' <<< $(curl -Ls -H "Accept: application/vnd.github+json" -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/Bandwidth/api-docs/releases?per_page=100))
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

- name: Create Pull Request
id: lts-pr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.DX_GITHUB_TOKEN }}
commit-message: Updating LTS Versions
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: Auto-Update-LTS
delete-branch: true
title: 'Updating LTS Versions'
body: |
- Auto-generated for LTS Version Update Workflow
labels: |
automated pr
draft: false
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
- name: Commit Changes and Create Pull Request
run: |
git add site/lts.config.json
git commit -m 'update lts table'
git push origin auto-update-lts
gh pr create -B main -H auto-update-lts --title 'Update LTS Versions Table' --body 'Auto-generated by Create LTS Versions Workflow'
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

0 comments on commit aa18765

Please sign in to comment.