This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWi-1991 Update LTS Release Table Job (#986)
- Loading branch information
Showing
1 changed file
with
20 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} |