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

Commit aa18765

Browse files
authored
SWi-1991 Update LTS Release Table Job (#986)
1 parent ab524d7 commit aa18765

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

.github/workflows/lts-release.yml

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,31 +63,26 @@ jobs:
6363
needs: [lts_needed, create_lts]
6464
if: ${{!needs.lts_needed.outputs.no_release}}
6565
steps:
66-
- name: Get Latest LTS Releases and Update the LTS config file
67-
run: |
68-
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))
69-
env:
70-
TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
66+
- name: Checkout
67+
uses: actions/checkout@v3
7168

72-
- uses: actions/checkout@v3
69+
- name: Configure Git and Create Branch
70+
run: |
71+
git config user.email "[email protected]"
72+
git config user.name "DX-Bandwidth"
73+
git checkout -b auto-update-lts
7374
74-
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
75+
- name: Get Latest LTS Releases and Update LTS Config File
76+
run: |
77+
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))
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
7580

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

0 commit comments

Comments
 (0)