Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto ts pr #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
run: |
./package/zip
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.vars.outputs.sha_short }}
name: Release ${{ github.ref }}-${{ steps.vars.outputs.sha_short }}
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/ruby-tree-sitter-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Create ruby-tree-sitter Pull Request on Release
on:
push
# release:
# types: [published]

jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v4

- name: Checkout ruby-tree-sitter
uses: actions/checkout@v4
with:
repository: stackmystack/ruby-tree-sitter
token: ${{ secrets.TREE_SITTER_PAT }}
path: ruby-tree-sitter

- name: Get previous releases
id: update_versions
run: |
cd ruby-tree-sitter
ls -lah .
TREE_SITTER=$(grep 'tree-sitter-version' parsers.toml | sed -E 's/.*"([0-9.]+)".*/\1/')
sed -i "s/^\([[:space:]]*\)TREESITTER_VERSION = '.*'/\1TREESITTER_VERSION = '$TREE_SITTER'/" lib/tree_sitter/version.rb
PARSERS=$(echo "${{ github.event.release.tag_name }}" | sed "s/^v//")
sed -i "s/(TS_PARSER_VERSION := \').*\'/\1$PARSERS\'/" .justfile
cd -

# Setup git config
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@github.com"

# Create new branch
BRANCH="update-parsers-to-$PARSERS"
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
git checkout -b "$BRANCH"

# Add and commit changes
git add .
git commit -m "Update from ${{ github.repository }} release ${{ github.event.release.tag_name }}"
git push origin "$BRANCH"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.TREE_SITTER_PAT }}
path: ruby-tree-sitter
base: master
delete-branch: true
draft: false
branch: ${{ steps.update_versions.outputs.branch }}
title: "Update from ${{ github.repository }} release ${{ github.event.release.tag_name }}"
body: |
This PR was automatically created to update from ${{ github.repository }} release ${{ github.event.release.tag_name }}.
2 changes: 1 addition & 1 deletion parsers.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tree-sitter-version = "0.23.0"
tree-sitter-version = "0.24.1"

[parsers]
bash = "0.23.0"
Expand Down
Loading