nuke RSS & custom db and replace with GraphQL requests #21
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
name: update-changesets | |
env: | |
WORKFLOW_FILE: update-changesets.yml | |
on: | |
issue_comment: | |
types: | |
- created | |
jobs: | |
build: | |
if: startsWith(github.event.comment.body, '/update-changesets') && github.event.issue.locked | |
name: 🛠️ Update changesets | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: read | |
steps: | |
- name: 🚚 Checkout (gh_pages) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: gh_pages | |
- name: 🔍 Check other workflows | |
run: | | |
# Get in-progress or queued workflows. | |
gh auth login --with-token < <(echo ${{ github.token }}) | |
RESULT=`gh run list --workflow ${{ env.WORKFLOW_FILE }} --json status --jq '[.[] | select(.status == "in_progress")] | length == 1'` | |
# [ERROR] Other workflows are in progress. | |
[ "$RESULT" = "false" ] && echo "::error::Other '${{ env.WORKFLOW_FILE }}' workflows are in progress." && exit 1 || : | |
- name: 🛠️ Update changesets file | |
run: npx unity-changeset list --all --all-lifecycles > db | |
- name: Commit & Push changes | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ github.token }} | |
amend: true | |
force: true | |
branch: gh_pages |