Skip to content

Commit

Permalink
Merge branch 'main' into patch-4
Browse files Browse the repository at this point in the history
  • Loading branch information
colindean authored Jan 23, 2023
2 parents 991ae8f + d2cdb27 commit d82e283
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/update-starlark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update starlark-go
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:

jobs:
update-starlark-go:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0

- uses: actions/setup-go@v3

- run: ./scripts/update-starlark.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
if: ${{ env.NEW_STARLARK_VERSION != null && env.NEW_STARLARK_VERSION != '' }}
with:
title: Update starlark-go to ${{ env.NEW_STARLARK_VERSION }}
branch: update-starlark-go
token: ${{ secrets.PR_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Starlark is a dialect of Python designed for hermetic execution and deterministi

This module was originally forked from Kevin Chung's [pystarlark](https://github.com/ColdHeat/pystarlark).

The version of starlark-go that is currently embedded in this module is [v0.0.0-20230122040757-066229b0515d](https://pkg.go.dev/go.starlark.net@v0.0.0-20230122040757-066229b0515d).

## Features

- Evalutes Starlark code from Python
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/caketop/python-starlark-go

go 1.18

require go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd
require go.starlark.net v0.0.0-20230122040757-066229b0515d

require golang.org/x/sys v0.4.0 // indirect
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM=
go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0=
go.starlark.net v0.0.0-20230122040757-066229b0515d h1:CTI+tbxvlfu7QlBj+4QjF8YPHoDh71h0/l2tXOM2k0o=
go.starlark.net v0.0.0-20230122040757-066229b0515d/go.mod h1:1NtVfE+l6AHFaY4GmUPGHeLIW8/THkXnym5iweVgCwU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down
20 changes: 20 additions & 0 deletions scripts/update-starlark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -euo pipefail

OLD_STARLARK_VERSION=$(grep 'require go.starlark.net' go.mod | cut -d' ' -f3)

go get -u go.starlark.net

NEW_STARLARK_VERSION=$(grep 'require go.starlark.net' go.mod | cut -d' ' -f3)

if [ "$NEW_STARLARK_VERSION" = "$OLD_STARLARK_VERSION" ]; then
echo "starlark-go is unchanged (still $NEW_STARLARK_VERSION)"
exit 0
fi

perl -i -pe "s/\Q$OLD_STARLARK_VERSION\E/$NEW_STARLARK_VERSION/g" README.md

if [ -n "${GITHUB_ENV:-}" ]; then
echo "NEW_STARLARK_VERSION=$NEW_STARLARK_VERSION" >> "$GITHUB_ENV"
fi

0 comments on commit d82e283

Please sign in to comment.